summaryrefslogtreecommitdiffstats
path: root/vm/alloc
diff options
context:
space:
mode:
authorSangWook Han <swhan@nemustech.com>2012-05-11 20:45:33 +0900
committerElliott Hughes <enh@google.com>2012-05-11 11:54:58 -0700
commit1ae25c55391a874638f6a6366d2c8359c811b168 (patch)
treea0f38c1dc155730e0b899097c076a068c0fb5616 /vm/alloc
parent20aeca6e2b18c07d3840f4b09f09186511148d8c (diff)
downloadandroid_dalvik-1ae25c55391a874638f6a6366d2c8359c811b168.tar.gz
android_dalvik-1ae25c55391a874638f6a6366d2c8359c811b168.tar.bz2
android_dalvik-1ae25c55391a874638f6a6366d2c8359c811b168.zip
Fix: Issue 26627: Dalvik Heap Trim timer value after GC
dvmRelativeCondWait need millisecods not seconds. With this fix, trim will begins 5 seconds after concurrent GC Bug: http://code.google.com/p/android/issues/detail?id=26627 Change-Id: I3802b48e345725fb78e4ef2c999dd243ef30a138
Diffstat (limited to 'vm/alloc')
-rw-r--r--vm/alloc/HeapSource.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm/alloc/HeapSource.cpp b/vm/alloc/HeapSource.cpp
index f61724a40..6552680d8 100644
--- a/vm/alloc/HeapSource.cpp
+++ b/vm/alloc/HeapSource.cpp
@@ -42,10 +42,10 @@ static void trimHeaps();
#define HEAP_IDEAL_FREE (2 * 1024 * 1024)
#define HEAP_MIN_FREE (HEAP_IDEAL_FREE / 4)
-/* Number of seconds to wait after a GC before performing a heap trim
+/* How long to wait after a GC before performing a heap trim
* operation to reclaim unused pages.
*/
-#define HEAP_TRIM_IDLE_TIME_SECONDS 5
+#define HEAP_TRIM_IDLE_TIME_MS (5 * 1000)
/* Start a concurrent collection when free memory falls under this
* many bytes.
@@ -410,7 +410,7 @@ static void *gcDaemonThread(void* arg)
bool trim = false;
if (gHs->gcThreadTrimNeeded) {
int result = dvmRelativeCondWait(&gHs->gcThreadCond, &gHs->gcThreadMutex,
- HEAP_TRIM_IDLE_TIME_SECONDS, 0);
+ HEAP_TRIM_IDLE_TIME_MS, 0);
if (result == ETIMEDOUT) {
/* Timed out waiting for a GC request, schedule a heap trim. */
trim = true;