summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2021-06-21 14:49:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-06-21 14:49:50 +0000
commitdd3a5b7e5501f9f0edc84abe1b5f9b9c611baff3 (patch)
treec3a58c4250572d3c837f2318ea8d13971fa57246
parent95c0a889007264dac4c6053d663f269cc1324046 (diff)
parent61f06523ccba139ebdf2b31d1b00fbc99b229e3f (diff)
downloadnative-dd3a5b7e5501f9f0edc84abe1b5f9b9c611baff3.tar.gz
Merge "Enable compiling dex files in isolation on low ram devices." into sc-dev
-rw-r--r--cmds/installd/run_dex2oat.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds/installd/run_dex2oat.cpp b/cmds/installd/run_dex2oat.cpp
index a27fd103a4..e847626a14 100644
--- a/cmds/installd/run_dex2oat.cpp
+++ b/cmds/installd/run_dex2oat.cpp
@@ -324,6 +324,12 @@ void RunDex2Oat::PrepareCompilerRuntimeAndPerfConfigFlags(bool post_bootcomplete
AddRuntimeArg(MapPropertyToArg("dalvik.vm.dex2oat-Xms", "-Xms%s"));
AddRuntimeArg(MapPropertyToArg("dalvik.vm.dex2oat-Xmx", "-Xmx%s"));
+
+ // Enable compiling dex files in isolation on low ram devices.
+ // It takes longer but reduces the memory footprint.
+ if (GetBoolProperty("ro.config.low_ram", false)) {
+ AddArg("--compile-individually");
+ }
}
void RunDex2Oat::Exec(int exit_code) {