RFR: More Partial Heuristics

Aleksey Shipilev shade at redhat.com
Wed May 24 16:44:21 UTC 2017


On 05/24/2017 03:32 PM, Christine Flood wrote:
> http://cr.openjdk.java.net/~chf/heuristics/webrev.00/

General:

*) I see new heuristics code does not make use of
ShMatrix::enumerate_connected_to, as ShPartialGC::prepare did, which might cost
5-10 ms per cycle, as we measured during ShPartialGC::prepare optimization. It
seems that the block from partial can be transplanted directly into new code?

*) ShenandoahCollectorPolicy already has record_cycle_{start|end} -- are those
the same as the new timestamp_at_last_gc_{start_end} methods?

*) Re:
 254     // Is this ever called, or do we always do deferred recycles when
 255     // using the matrix?
 256     _heap->connection_matrix()->clear_region(region_number());

...we don't call recycle() now, but it should be safe to call without deferred
recycling, so matrix is cleaned on that path too


Code quality:

*) Replace:
 ShenandoahHeap* heap = (ShenandoahHeap*)Universe::heap();

...with:
 ShenandoahHeap* heap = ShenandoahHeap::heap();

*) Braces:

 842     for (size_t i = 0; i < active; i++)
 843       sorted_regions.add_region(regions->get(i));

1216   if (minor)
1217     _minor_heuristics->choose_collection_set(collection_set, matrix);
1218   else
1219     _heuristics->choose_collection_set(collection_set, matrix);

1446   if (_minor_heuristics != NULL)
1447     return _minor_heuristics->should_start_partial_gc();
1448   else return false;

*) Can reuse "heap":

 913     ShenandoahHeap* heap = ShenandoahHeap::heap();
 914     // For now don't start until we are 50% full
 915     size_t threshold = ShenandoahHeap::heap()->regions()->active_regions() *
 916       percentage_old / 100 *
 917       ShenandoahHeapRegion::region_size_bytes();
 918     size_t minimum = ShenandoahHeap::heap()->regions()->active_regions() *
 919       0.5 *
 920       ShenandoahHeapRegion::region_size_bytes();

*) "\n" are not needed in log_info(...) statements

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list