diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-11-22 17:58:48 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-11-22 18:00:45 -0800 |
commit | 0de9f73afe3e835b63f2ee0c1416930656449f3f (patch) | |
tree | ebe8c36cb194c7f662b53452f53e5ad7f712e50e /runtime/runtime.cc | |
parent | 2e899a92439dc6bdaaa67b8230933006284aa600 (diff) | |
download | art-0de9f73afe3e835b63f2ee0c1416930656449f3f.zip art-0de9f73afe3e835b63f2ee0c1416930656449f3f.tar.gz art-0de9f73afe3e835b63f2ee0c1416930656449f3f.tar.bz2 |
Add -xGc: MS, CMS, SS options to specify which GC to use.
Can be used for running tests or benchmarks with semispace,
marksweep or concurrent marksweep.
Change-Id: Ic9ab1220150f2c7c9c30df4ffee45b9d303094b3
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 896f7ff..6bd2560 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -363,6 +363,8 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b parsed->parallel_gc_threads_ = sysconf(_SC_NPROCESSORS_CONF) - 1; // Only the main GC thread, no workers. parsed->conc_gc_threads_ = 0; + // Default is CMS which is Sticky + Partial + Full CMS GC. + parsed->collector_type_ = gc::kCollectorTypeCMS; parsed->stack_size_ = 0; // 0 means default. parsed->max_spins_before_thin_lock_inflation_ = Monitor::kDefaultMaxSpinsBeforeThinLockInflation; parsed->low_memory_mode_ = false; @@ -370,7 +372,6 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b parsed->is_compiler_ = false; parsed->is_zygote_ = false; parsed->interpreter_only_ = false; - parsed->is_concurrent_gc_enabled_ = true; parsed->is_explicit_gc_disabled_ = false; parsed->long_pause_log_threshold_ = gc::Heap::kDefaultLongPauseLogThreshold; @@ -556,10 +557,12 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b std::vector<std::string> gc_options; Split(option.substr(strlen("-Xgc:")), ',', gc_options); for (size_t i = 0; i < gc_options.size(); ++i) { - if (gc_options[i] == "noconcurrent") { - parsed->is_concurrent_gc_enabled_ = false; - } else if (gc_options[i] == "concurrent") { - parsed->is_concurrent_gc_enabled_ = true; + if (gc_options[i] == "MS" || gc_options[i] == "nonconcurrent") { + parsed->collector_type_ = gc::kCollectorTypeMS; + } else if (gc_options[i] == "CMS" || gc_options[i] == "concurrent") { + parsed->collector_type_ = gc::kCollectorTypeCMS; + } else if (gc_options[i] == "SS") { + parsed->collector_type_ = gc::kCollectorTypeSS; } else { LOG(WARNING) << "Ignoring unknown -Xgc option: " << gc_options[i]; } @@ -916,7 +919,7 @@ 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->collector_type_, options->parallel_gc_threads_, options->conc_gc_threads_, options->low_memory_mode_, |