From: Carl Shapiro Date: Wed, 29 Sep 2010 03:30:42 +0000 (-0700) Subject: After trimming, set the footprint to the number of pages in use. X-Git-Tag: android-x86-4.0-r1~164^2~18^2~12^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=718509c35413c01a866c848d019d8ca28b425bf6;p=android-x86%2Fdalvik.git After trimming, set the footprint to the number of pages in use. A trim can decrease the an mspace footprint but it will not decrease its max footprint. We need to decrease the max footprint to make any pages recovered by a trim available to external allocations. By setting the ideal footprint after a trim we lift any soft limit in effect and make the mspace footprint and max footprints equal. Change-Id: Ia6eb99634ce1d732b417a90291b110d1fc46c2e3 --- diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c index 25e0125f2..46b1c78f3 100644 --- a/vm/alloc/HeapSource.c +++ b/vm/alloc/HeapSource.c @@ -1685,6 +1685,7 @@ static bool externalAllocPossible(const HeapSource *hs, size_t n) * Try trimming the mspace to reclaim unused pages. */ dvmHeapSourceTrim(bytesTrimmed, NELEM(bytesTrimmed)); + snapIdealFootprint(); if (externalBytesAvailable(hs, n)) { return true; }