summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2014-12-13 01:28:36 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-12-13 01:28:37 +0000
commit152f391b17080e2dcc2294425c7fa2afe73a4f44 (patch)
tree25127f4a04de79c582e54b62fe180614d114dec1
parentecdf72cdf2b2cb6f599c2bef32f174570b0fd196 (diff)
parentd0e0d4c833b82ac2639de9dea6042ccb87fe37ed (diff)
Merge "Disable HomogeneousSpaceCompact for GSS collector"
-rw-r--r--runtime/gc/space/malloc_space.cc3
-rw-r--r--runtime/parsed_options.cc16
2 files changed, 11 insertions, 8 deletions
diff --git a/runtime/gc/space/malloc_space.cc b/runtime/gc/space/malloc_space.cc
index 43a2c59a49..7905bb4854 100644
--- a/runtime/gc/space/malloc_space.cc
+++ b/runtime/gc/space/malloc_space.cc
@@ -173,7 +173,8 @@ ZygoteSpace* MallocSpace::CreateZygoteSpace(const char* alloc_space_name, bool l
// stored in between objects.
// Remaining size is for the new alloc space.
const size_t growth_limit = growth_limit_ - size;
- const size_t capacity = Capacity() - size;
+ // Use mem map limit in case error for clear growth limit.
+ const size_t capacity = NonGrowthLimitCapacity() - size;
VLOG(heap) << "Begin " << reinterpret_cast<const void*>(begin_) << "\n"
<< "End " << reinterpret_cast<const void*>(End()) << "\n"
<< "Size " << size << "\n"
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 3e6c86b7c9..1b992d5159 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -691,11 +691,16 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
return false;
}
}
- // If not set, background collector type defaults to homogeneous compaction
- // if not low memory mode, semispace otherwise.
+ // If not set, background collector type defaults to homogeneous compaction.
+ // If foreground is GSS, use GSS as background collector.
+ // If not low memory mode, semispace otherwise.
if (background_collector_type_ == gc::kCollectorTypeNone) {
- background_collector_type_ = low_memory_mode_ ?
- gc::kCollectorTypeSS : gc::kCollectorTypeHomogeneousSpaceCompact;
+ if (collector_type_ != gc::kCollectorTypeGSS) {
+ background_collector_type_ = low_memory_mode_ ?
+ gc::kCollectorTypeSS : gc::kCollectorTypeHomogeneousSpaceCompact;
+ } else {
+ background_collector_type_ = collector_type_;
+ }
}
// If a reference to the dalvik core.jar snuck in, replace it with
@@ -722,9 +727,6 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
if (heap_growth_limit_ == 0) {
heap_growth_limit_ = heap_maximum_size_;
}
- if (background_collector_type_ == gc::kCollectorTypeNone) {
- background_collector_type_ = collector_type_;
- }
return true;
} // NOLINT(readability/fn_size)