Split inter-region ref bitmap for every space
Currently, one bitmap is created which covers both region-space and
non-moving-space. Also, this bitmap is created and destroyed in each GC
cycle. This becomes a problem on 32-bit processes (especially during
gcstress tests) due to limited availability of address space.
In this change, two separate bitmaps are created for both the spaces.
This is done once during startup, and then the bitmaps are reused for
the lifetime of process.
Test: art/test/testrunner/testrunner.py --host --gcstress --32
Bug: 112720851
Change-Id: I6fc1dbd5dab10b39b2fd2d436a678e319feb78e7
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index d868aba..bf8aaae 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -666,6 +666,9 @@
concurrent_copying_collector_->SetRegionSpace(region_space_);
if (kEnableGenerationalConcurrentCopyingCollection) {
young_concurrent_copying_collector_->SetRegionSpace(region_space_);
+ // At this point, non-moving space should be created.
+ DCHECK(non_moving_space_ != nullptr);
+ concurrent_copying_collector_->CreateInterRegionRefBitmaps();
}
garbage_collectors_.push_back(concurrent_copying_collector_);
if (kEnableGenerationalConcurrentCopyingCollection) {
@@ -2736,7 +2739,7 @@
// active_concurrent_copying_collector_. So we should not concurrency here.
active_concurrent_copying_collector_ = (gc_type == collector::kGcTypeSticky) ?
young_concurrent_copying_collector_ : concurrent_copying_collector_;
- active_concurrent_copying_collector_->SetRegionSpace(region_space_);
+ DCHECK(active_concurrent_copying_collector_->RegionSpace() == region_space_);
}
collector = active_concurrent_copying_collector_;
break;