RFR: Add regular regions to free set after partial GC
Aleksey Shipilev
shade at redhat.com
Thu Aug 24 17:32:35 UTC 2017
This is the leftover from LRU/Generational work. It was deemed necessary to avoid allocating in
non-empty regions to keep allocation timestamps in order. After some discussion, it seems that we
can still allocate in regular regions after partial GC.
Now, the tricky part is that we have to still add root regions to _root_regions, otherwise
everything breaks. Note that this fix means root regions are in free set, which means we could
evacuate objects from cset to root regions. I think this is not problematic -- it fact, preferring
root regions over other reduces heap connectedness?
Fixes TODO:
$ hg diff
diff -r 1c4b11eebdc1 src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp
--- a/src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp Thu Aug 24 19:01:03 2017 +0200
+++ b/src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp Thu Aug 24 19:26:02 2017 +0200
@@ -230,9 +230,10 @@
for (uint from_idx = 0; from_idx < num_regions; from_idx++) {
ShenandoahHeapRegion* r = regions->get(from_idx);
- if (r->is_empty()) { // TODO: Should be is_alloc_allowed here, to capture regular regions too?
+ if (r->is_alloc_allowed()) {
_free_regions->add_region(r);
- } else if (r->is_root() && !r->in_collection_set()) {
+ }
+ if (r->is_root() && !r->in_collection_set()) {
_root_regions->add_region(r);
matrix->clear_region_outbound(from_idx);
}
Testing: hotspot_gc_shenandoah
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list