summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-08-13 18:07:31 -0700
committer Mathieu Chartier <mathieuc@google.com> 2014-08-13 18:24:59 -0700
commit22e4bb062671bd871d0d4fd5ee51bc115dba9aaa (patch)
tree72ed1d9ebdf7dd0cf85be94841c7903b0c932a8e
parent3e6ff5bcf6f365fd869a5ce62235d4957c71bdbe (diff)
Use homogeneous space compaction for non low memory devices.
Saves nearly as much memory without needing the foreground transition. TODO: Pass in these flags from AndroidRuntime.cpp. Bug: 16401001 Change-Id: Iecad0cc0c04fdf9cabe6f9d7f87c761a94b4142c
-rw-r--r--runtime/parsed_options.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 3ef7a17615..27f776544a 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -206,7 +206,7 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
// If background_collector_type_ is kCollectorTypeNone, it defaults to the collector_type_ after
// parsing options. If you set this to kCollectorTypeHSpaceCompact then we will do an hspace
// compaction when we transition to background instead of a normal collector transition.
- background_collector_type_ = gc::kCollectorTypeSS;
+ background_collector_type_ = gc::kCollectorTypeHomogeneousSpaceCompact;
stack_size_ = 0; // 0 means default.
max_spins_before_thin_lock_inflation_ = Monitor::kDefaultMaxSpinsBeforeThinLockInflation;
low_memory_mode_ = false;
@@ -394,6 +394,10 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
} else if (option == "-XX:IgnoreMaxFootprint") {
ignore_max_footprint_ = true;
} else if (option == "-XX:LowMemoryMode") {
+ if (background_collector_type_ == gc::kCollectorTypeHomogeneousSpaceCompact) {
+ // Use semispace instead of homogenous space compact for low memory mode.
+ background_collector_type_ = gc::kCollectorTypeSS;
+ }
low_memory_mode_ = true;
// TODO Might want to turn off must_relocate here.
} else if (option == "-XX:UseTLAB") {