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:39:10 +0000 (10:39 -0700)
commit23d683ff957ed9967a045ad3da61f4a4e3c99f2a
tree83dd1cdda19eb56a5997246eb48d69959ec932fa
parent5355835411cafcc2772e061cb7aef3b8ca1e6ea1
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.

(cherry picked from commit 698b44634396e8111e96e1116586fde89a838347)

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