am dae9f5a5: am f3a2430a: am 738fa2f6: Merge "Add dalvik.vm.gctype to enable switching between different GCs."
* commit 'dae9f5a5158257c65fae014b38bde08741b97e62':
Add dalvik.vm.gctype to enable switching between different GCs.
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index d501dd8..783e794 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -447,6 +447,7 @@
char heapgrowthlimitOptsBuf[sizeof("-XX:HeapGrowthLimit=")-1 + PROPERTY_VALUE_MAX];
char heapminfreeOptsBuf[sizeof("-XX:HeapMinFree=")-1 + PROPERTY_VALUE_MAX];
char heapmaxfreeOptsBuf[sizeof("-XX:HeapMaxFree=")-1 + PROPERTY_VALUE_MAX];
+ char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX];
char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
char jitcodecachesizeOptsBuf[sizeof("-Xjitcodecachesize:")-1 + PROPERTY_VALUE_MAX];
char extraOptsBuf[PROPERTY_VALUE_MAX];
@@ -582,6 +583,13 @@
mOptions.add(opt);
}
+ strcpy(gctypeOptsBuf, "-Xgc:");
+ property_get("dalvik.vm.gctype", gctypeOptsBuf+5, "");
+ if (gctypeOptsBuf[5] != '\0') {
+ opt.optionString = gctypeOptsBuf;
+ mOptions.add(opt);
+ }
+
/*
* Enable or disable dexopt features, such as bytecode verification and
* calculation of register maps for precise GC.