summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2019-08-29 11:59:15 -0700
committerMathieu Chartier <mathieuc@google.com>2019-08-29 12:03:09 -0700
commit83bea97333da7b4337aaa826b2104ebab8ae42ec (patch)
tree04f9e2d2094f8f31528182a67db34d457adb27b1 /core/java
parentcc55cca98505c740acf8702e720378311197e46e (diff)
Clean up class preloading
Remove logic to set heap target utilization to 0.8. The default is 0.75 and this should not have any fragmentation benefit since the GC is compacting. Removed some unused logging and a variable. Test: TH Change-Id: Ife7219e94fa0aa7f489569e16248cdd23d09089a
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java15
1 files changed, 0 insertions, 15 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 2abc8c080ac1..b03e76b9e3f0 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -94,11 +94,6 @@ public class ZygoteInit {
private static final int LOG_BOOT_PROGRESS_PRELOAD_START = 3020;
private static final int LOG_BOOT_PROGRESS_PRELOAD_END = 3030;
- /**
- * when preloading, GC after allocating this many bytes
- */
- private static final int PRELOAD_GC_THRESHOLD = 50000;
-
private static final String ABI_LIST_ARG = "--abi-list=";
// TODO (chriswailes): Re-name this --zygote-socket-name= and then add a
@@ -278,11 +273,6 @@ public class ZygoteInit {
droppedPriviliges = true;
}
- // Alter the target heap utilization. With explicit GCs this
- // is not likely to have any effect.
- float defaultUtilization = runtime.getTargetHeapUtilization();
- runtime.setTargetHeapUtilization(0.8f);
-
try {
BufferedReader br =
new BufferedReader(new InputStreamReader(is), Zygote.SOCKET_BUFFER_SIZE);
@@ -298,9 +288,6 @@ public class ZygoteInit {
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, line);
try {
- if (false) {
- Log.v(TAG, "Preloading " + line + "...");
- }
// Load and explicitly initialize the given class. Use
// Class.forName(String, boolean, ClassLoader) to avoid repeated stack lookups
// (to derive the caller's class-loader). Use true to force initialization, and
@@ -331,8 +318,6 @@ public class ZygoteInit {
Log.e(TAG, "Error reading " + PRELOADED_CLASSES + ".", e);
} finally {
IoUtils.closeQuietly(is);
- // Restore default.
- runtime.setTargetHeapUtilization(defaultUtilization);
// Fill in dex caches with classes, fields, and methods brought in by preloading.
Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadDexCaches");