OSDN Git Service

Fix heap trimmer daemon sleeping.
authorMathieu Chartier <mathieuc@google.com>
Thu, 4 Sep 2014 04:26:36 +0000 (21:26 -0700)
committerMathieu Chartier <mathieuc@google.com>
Thu, 4 Sep 2014 17:31:35 +0000 (10:31 -0700)
commit698b44634396e8111e96e1116586fde89a838347
treeb0e5cda5aa7aa9915b9bf64a57f66ea28750cb78
parente1a8662792260953efe05fd991d945e508298aa8
Fix heap trimmer daemon sleeping.

Problem:
Heap trimmer daemon sleeping caused app launch occasionally to take a
while due stopping the heap trimming thread taking a long time.

The heap trimmer thread now never sleeps, we prevent issues caused
by frequent back and forth process state changes by only
transitioning to background if it has been kCollectorTransitionWait
time since the last transition to background. Similar logic for heap
trimming.

Bug: 17310019

Change-Id: I23980421cc388f36b66a4c03ed15dd11d43f59b5
runtime/gc/heap.cc
runtime/gc/heap.h