summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-09-09 01:22:38 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-09-09 01:22:39 +0000
commitc13b42a9266d3aa5c9dda75c48f7ce3fcafc116c (patch)
tree878d4aaeaf0a08f64d8c0b30ab80c40b70aaf019
parent0d42a1759414ab6887bd5e05ea87cab296118352 (diff)
parent30cbbee37d9fcca1a39b3681434180102ee5251a (diff)
Merge "Ignore heap trim requests if we are the zygote"
-rw-r--r--runtime/gc/heap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index f95a68ed6a..2048160378 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -3013,7 +3013,10 @@ void Heap::RequestHeapTrim() {
Thread* self = Thread::Current();
Runtime* runtime = Runtime::Current();
- if (runtime == nullptr || !runtime->IsFinishedStarting() || runtime->IsShuttingDown(self)) {
+ if (runtime == nullptr || !runtime->IsFinishedStarting() || runtime->IsShuttingDown(self) ||
+ runtime->IsZygote()) {
+ // Ignore the request if we are the zygote to prevent app launching lag due to sleep in heap
+ // trimmer daemon. b/17310019
// Heap trimming isn't supported without a Java runtime or Daemons (such as at dex2oat time)
// Also: we do not wish to start a heap trim if the runtime is shutting down (a racy check
// as we don't hold the lock while requesting the trim).