diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-08-05 10:17:40 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-08-05 14:53:05 -0700 |
commit | e0a53e99e2a01f8668d6616c3cec7e2f5a711286 (patch) | |
tree | d672967f101a31e1dbf739a2e13f0725625e2ca2 /runtime/runtime.cc | |
parent | f929b1f270a880e1f98c7a3913a5a5468a2a2368 (diff) | |
download | art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.zip art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.tar.gz art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.tar.bz2 |
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
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b // 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 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b 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 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) { 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(); |