Add low memory mode option to ART.
Useful so that we match the option I added here:
https://googleplex-android-review.googlesource.com/#/c/328940/
In ART low memory mode reduces the maximum number of histogram
buckets. We also trim no matter the utilization.
Change-Id: I655ba63312c0a6574569cdd5171ca81ea338c2aa
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 485c636..5298181 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -341,6 +341,7 @@
// Default to number of processors minus one since the main GC thread also does work.
parsed->heap_gc_threads_ = sysconf(_SC_NPROCESSORS_CONF) - 1;
parsed->stack_size_ = 0; // 0 means default.
+ parsed->low_memory_mode_ = false;
parsed->is_compiler_ = false;
parsed->is_zygote_ = false;
@@ -488,6 +489,8 @@
return NULL;
}
parsed->stack_size_ = size;
+ } else if (option == "-XX:LowMemoryMode") {
+ parsed->low_memory_mode_ = true;
} else if (StartsWith(option, "-D")) {
parsed->properties_.push_back(option.substr(strlen("-D")));
} else if (StartsWith(option, "-Xjnitrace:")) {
@@ -835,7 +838,8 @@
options->heap_maximum_size_,
options->image_,
options->is_concurrent_gc_enabled_,
- options->heap_gc_threads_);
+ options->heap_gc_threads_,
+ options->low_memory_mode_);
BlockSignals();
InitPlatformSignalHandlers();