RFR: Report young regions only in logged age census at end of each GC

Aleksey Shipilev shade at openjdk.org
Tue Mar 21 09:26:44 UTC 2023


On Mon, 20 Mar 2023 23:46:27 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> We are primarily interested in the young-gen aged regions.  It is confusing for the log report to add the live data pertaining to old-gen regions which happen to have age > 0.

Let's just print "Young regions" and "Old regions" separately?


  AgeTable young_region_ages(false);
  AgeTable old_region_ages(false);
  ShenandoahHeap* heap = ShenandoahHeap::heap();
  for (uint i = 0; i < heap->num_regions(); ++i) {
    ShenandoahHeapRegion* r = heap->get_region(i);
    if (r->age() > 0 && r->age() < AgeTable::table_size) {
      if (r->young()) {
        young_region_ages.add(r->age(), r->get_live_data_words());
      } else {
        old_region_ages.add(r->age(), r->get_live_data_words());
      }
    }
  }
  st->print("Young regions: ");
  young_region_ages.print_on(st, InitialTenuringThreshold);
  st->cr();
  st->print("Old regions: ");
  old_region_ages.print_on(st, InitialTenuringThreshold);

-------------

PR Review: https://git.openjdk.org/shenandoah/pull/230#pullrequestreview-1349996321


More information about the shenandoah-dev mailing list