summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-01-08 14:42:20 -0800
committerMathieu Chartier <mathieuc@google.com>2015-01-08 14:42:20 -0800
commit24cee07160ec19c16198300bf8e3ec46c5806c54 (patch)
treefea94c4c003d19d91e90109d9947c26174196f0d /core/java/android/app
parentda90a9c2355841bb98c2a669446b93ffe487a829 (diff)
downloadframeworks_base-24cee07160ec19c16198300bf8e3ec46c5806c54.zip
frameworks_base-24cee07160ec19c16198300bf8e3ec46c5806c54.tar.gz
frameworks_base-24cee07160ec19c16198300bf8e3ec46c5806c54.tar.bz2
Call VMRuntime.clampGrowthLimit for small heap apps
If the manifest doesn't specify large heaps, we now call VMRuntime.clampGrowthLimit to release heap virtual address space which won't ever get used. Bug: 18387825 Bug: 17131630 Change-Id: I61fdcd70c70234256637eeebefe3abb22b91095d
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/ActivityThread.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 6233676..978366e 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4481,6 +4481,10 @@ public final class ActivityThread {
if ((data.appInfo.flags&ApplicationInfo.FLAG_LARGE_HEAP) != 0) {
dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
+ } else {
+ // Small heap, clamp to the current growth limit and let the heap release
+ // pages after the growth limit to the non growth limit capacity. b/18387825
+ dalvik.system.VMRuntime.getRuntime().clampGrowthLimit();
}
// Allow disk access during application and provider setup. This could