diff options
| author | 2014-07-14 14:57:16 -0700 | |
|---|---|---|
| committer | 2014-07-16 12:34:43 -0700 | |
| commit | 4c13a3ff475f206c4d0a86ee2595c45392fd942f (patch) | |
| tree | 5a96dff1dd5952aa70c2f25de46ea89d93e9225b /runtime/gc/heap.cc | |
| parent | 524e5e3815d2b16ee77beda9976b7ec3aa54aba6 (diff) | |
Disable adding main and non moving spaces to immune region in GSS
Disabled adding the main and non moving space to the immune region.
This will enable us to recycle bump pointer spaces for malloc space
-> malloc space compaction as well as collector transitions.
Also added logic for falling back to the non moving space, we may
copy objects there.
Refactored mod union table logic into MarkReachableObjects.
No measurable performance benefit or regression.
Bug: 14059466
Bug: 16291259
Change-Id: If663d9fdbde943b988173b7f6ac844e5f78a0327
Diffstat (limited to 'runtime/gc/heap.cc')
| -rw-r--r-- | runtime/gc/heap.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 4ec9bc2f6a..696df322aa 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1126,7 +1126,13 @@ bool Heap::IsLiveObjectLocked(mirror::Object* obj, bool search_allocation_stack, return false; } -void Heap::DumpSpaces(std::ostream& stream) { +std::string Heap::DumpSpaces() const { + std::ostringstream oss; + DumpSpaces(oss); + return oss.str(); +} + +void Heap::DumpSpaces(std::ostream& stream) const { for (const auto& space : continuous_spaces_) { accounting::ContinuousSpaceBitmap* live_bitmap = space->GetLiveBitmap(); accounting::ContinuousSpaceBitmap* mark_bitmap = space->GetMarkBitmap(); @@ -1159,10 +1165,7 @@ void Heap::VerifyObjectBody(mirror::Object* obj) { if (verify_object_mode_ > kVerifyObjectModeFast) { // Note: the bitmap tests below are racy since we don't hold the heap bitmap lock. - if (!IsLiveObjectLocked(obj)) { - DumpSpaces(); - LOG(FATAL) << "Object is dead: " << obj; - } + CHECK(IsLiveObjectLocked(obj)) << "Object is dead " << obj << "\n" << DumpSpaces(); } } @@ -2354,7 +2357,7 @@ size_t Heap::VerifyHeapReferences(bool verify_referents) { accounting::RememberedSet* remembered_set = table_pair.second; remembered_set->Dump(LOG(ERROR) << remembered_set->GetName() << ": "); } - DumpSpaces(); + DumpSpaces(LOG(ERROR)); } return visitor.GetFailureCount(); } @@ -2471,12 +2474,7 @@ bool Heap::VerifyMissingCardMarks() { visitor(*it); } } - - if (visitor.Failed()) { - DumpSpaces(); - return false; - } - return true; + return !visitor.Failed(); } void Heap::SwapStacks(Thread* self) { @@ -2574,9 +2572,8 @@ void Heap::PreGcVerificationPaused(collector::GarbageCollector* gc) { ReaderMutexLock mu(self, *Locks::heap_bitmap_lock_); SwapStacks(self); // Sort the live stack so that we can quickly binary search it later. - if (!VerifyMissingCardMarks()) { - LOG(FATAL) << "Pre " << gc->GetName() << " missing card mark verification failed"; - } + CHECK(VerifyMissingCardMarks()) << "Pre " << gc->GetName() + << " missing card mark verification failed\n" << DumpSpaces(); SwapStacks(self); } if (verify_mod_union_table_) { |