summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-03-07 17:27:52 -0800
committer Mathieu Chartier <mathieuc@google.com> 2019-03-08 16:46:32 +0000
commit43c23b8bccd6823f40fa71c2f2fa2f7d47a930bd (patch)
tree75877ff7e99a0fc957e8c44760b98e1e8d69f626
parent370a06477c418a2887528a593601a99c2ab828cd (diff)
Delete thread pool in NotifyStartupCompleted
Delete the thread pool when startup is completed instead of during heap trim. Bug: 120671223 Test: test-art-host Change-Id: I9715930db7045f46cb70b7fd71b33c00a61b7ac4
-rw-r--r--runtime/gc/heap.cc5
-rw-r--r--runtime/runtime.cc6
2 files changed, 6 insertions, 5 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 83357990be..5c171e6f63 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1422,11 +1422,6 @@ void Heap::Trim(Thread* self) {
TrimSpaces(self);
// Trim arenas that may have been used by JIT or verifier.
runtime->GetArenaPool()->TrimMaps();
- {
- // TODO: Move this to a callback called when startup is finished (b/120671223).
- ScopedTrace trace2("Delete thread pool");
- runtime->DeleteThreadPool();
- }
}
class TrimIndirectReferenceTableClosure : public Closure {
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 6ab5d98dd4..55392052f7 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -2784,6 +2784,12 @@ void Runtime::NotifyStartupCompleted() {
// Notify the profiler saver that startup is now completed.
ProfileSaver::NotifyStartupCompleted();
+
+ {
+ // Delete the thread pool used for app image loading startup is completed.
+ ScopedTrace trace2("Delete thread pool");
+ DeleteThreadPool();
+ }
}
bool Runtime::GetStartupCompleted() const {