From bbbe552a31f7229708bfc748480ce538218ae076 Mon Sep 17 00:00:00 2001 From: buzbee Date: Thu, 23 May 2013 13:53:50 -0700 Subject: JIT tuning; set cache size on command line The tuning knobs for triggering trace compilation for the JIT had not been revisited for several years. In that time, the working set of some applications have significantly increased, leading to frequent cache overlows & flushes. This CL adds the ability to set the maximum size of the JIT's cache on the command line, and we expect to use different settings depending on device configuration (rule of thumb: 1K for each 1M for system RAM, with 2M limit). Additionally, the trace compilation trigger has been tightened to limit the compilation of cold traces. Change-Id: Ice22c5d9d46a93e465c57dd83f50ca3912f1672e --- vm/Init.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vm/Init.cpp') diff --git a/vm/Init.cpp b/vm/Init.cpp index bcb2824ae..6719e1c12 100644 --- a/vm/Init.cpp +++ b/vm/Init.cpp @@ -141,6 +141,7 @@ static void usage(const char* progName) "[,hexopvalue[-endvalue]]*\n"); dvmFprintf(stderr, " -Xincludeselectedmethod\n"); dvmFprintf(stderr, " -Xjitthreshold:decimalvalue\n"); + dvmFprintf(stderr, " -Xjitcodecachesize:decimalvalueofkbytes\n"); dvmFprintf(stderr, " -Xjitblocking\n"); dvmFprintf(stderr, " -Xjitmethod:signature[,signature]* " "(eg Ljava/lang/String\\;replace)\n"); @@ -1126,6 +1127,8 @@ static int processOptions(int argc, const char* const argv[], gDvmJit.blockingMode = true; } else if (strncmp(argv[i], "-Xjitthreshold:", 15) == 0) { gDvmJit.threshold = atoi(argv[i] + 15); + } else if (strncmp(argv[i], "-Xjitcodecachesize:", 19) == 0) { + gDvmJit.codeCacheSize = atoi(argv[i] + 19) * 1024; } else if (strncmp(argv[i], "-Xincludeselectedop", 19) == 0) { gDvmJit.includeSelectedOp = true; } else if (strncmp(argv[i], "-Xincludeselectedmethod", 23) == 0) { @@ -1281,6 +1284,7 @@ static void setCommandLineDefaults() gDvmJit.includeSelectedOffset = false; gDvmJit.methodTable = NULL; gDvmJit.classTable = NULL; + gDvmJit.codeCacheSize = DEFAULT_CODE_CACHE_SIZE; gDvm.constInit = false; gDvm.commonInit = false; -- cgit v1.2.3