summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-06-27 14:15:19 -0700
committerBrian Carlstrom <bdc@google.com>2014-06-27 14:15:19 -0700
commit3aa138617b42b87069dbac0b441bd14dca2d8609 (patch)
tree3440e8dd445625eaa6e99380917cdf9a5cd529df /cmds
parentab57491de3a89a2d454d3060d36adef71741a7ae (diff)
downloadframeworks_native-3aa138617b42b87069dbac0b441bd14dca2d8609.zip
frameworks_native-3aa138617b42b87069dbac0b441bd14dca2d8609.tar.gz
frameworks_native-3aa138617b42b87069dbac0b441bd14dca2d8609.tar.bz2
Use current max product dalvik.vm.heapsize as default dex2oat heap size
Bug: 15919420 Change-Id: I7ea3bbfe787026f272e50690ab3b84f894600191
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/commands.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 01eb5ef..ca30f91 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -633,6 +633,11 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
bool profiler = (property_get("dalvik.vm.profiler", prop_buf, "0") > 0) && (prop_buf[0] == '1');
static const char* DEX2OAT_BIN = "/system/bin/dex2oat";
+
+ // TODO: Make this memory value configurable with a system property b/15919420
+ static const char* RUNTIME_ARG = "--runtime-arg";
+ static const char* MEMORY_MAX_ARG = "-Xmx512m";
+
static const int MAX_INT_LEN = 12; // '-'+10dig+'\0' -OR- 0x+8dig
static const unsigned int MAX_INSTRUCTION_SET_LEN = 32;
@@ -676,12 +681,14 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name,
ALOGV("Running %s in=%s out=%s\n", DEX2OAT_BIN, input_file_name, output_file_name);
- char* argv[7 // program name, mandatory arguments and the final NULL
+ char* argv[9 // program name, mandatory arguments and the final NULL
+ (have_profile_file ? 1 : 0)
+ (have_top_k_profile_threshold ? 1 : 0)
+ (have_dex2oat_flags ? 1 : 0)];
int i = 0;
argv[i++] = (char*)DEX2OAT_BIN;
+ argv[i++] = (char*)RUNTIME_ARG;
+ argv[i++] = (char*)MEMORY_MAX_ARG;
argv[i++] = zip_fd_arg;
argv[i++] = zip_location_arg;
argv[i++] = oat_fd_arg;