diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-07-23 14:04:34 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-07-23 14:04:34 -0700 |
commit | 3489af22a126e135acfc3c93beec9c31999c0ce6 (patch) | |
tree | 2ff3d04dea669ec31f84f35108de4171d3fc9e37 /runtime/runtime.cc | |
parent | a3d6b8cb884fce2fe34258e9d582b11ea9545fd9 (diff) | |
parent | 63a54345598861030178e033ffbd72c0e231a4c9 (diff) | |
download | art-3489af22a126e135acfc3c93beec9c31999c0ce6.tar.gz art-3489af22a126e135acfc3c93beec9c31999c0ce6.tar.bz2 art-3489af22a126e135acfc3c93beec9c31999c0ce6.zip |
am 63a54345: Add option for changing number of GC threads.
* commit '63a54345598861030178e033ffbd72c0e231a4c9':
Add option for changing number of GC threads.
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index ba183111ec..cf6e537df0 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -338,6 +338,8 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b parsed->heap_max_free_ = gc::Heap::kDefaultMaxFree; parsed->heap_target_utilization_ = gc::Heap::kDefaultTargetUtilization; parsed->heap_growth_limit_ = 0; // 0 means no growth limit. + // 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->is_compiler_ = false; @@ -472,6 +474,9 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b return NULL; } parsed->heap_target_utilization_ = value; + } else if (StartsWith(option, "-XX:HeapGCThreads=")) { + parsed->heap_gc_threads_ = + ParseMemoryOption(option.substr(strlen("-XX:HeapGCThreads=")).c_str(), 1024); } else if (StartsWith(option, "-Xss")) { size_t size = ParseMemoryOption(option.substr(strlen("-Xss")).c_str(), 1); if (size == 0) { @@ -829,7 +834,8 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) { options->heap_target_utilization_, options->heap_maximum_size_, options->image_, - options->is_concurrent_gc_enabled_); + options->is_concurrent_gc_enabled_, + options->heap_gc_threads_); BlockSignals(); InitPlatformSignalHandlers(); |