RFR (S): 8131734: Add free_archive_regions support to G1 for -Xshared:auto

Thomas Schatzl thomas.schatzl at oracle.com
Wed Aug 5 13:52:37 UTC 2015


Hi again,

[...]
> - I have some question about this code, particularly about the comment:
> 
> 1137     HeapRegion* start_region = _hrm.addr_to_region(start_address);
> 1138     HeapRegion* last_region = _hrm.addr_to_region(last_address);
> 1139 
> 1140     // Check for ranges that start in the same G1 region in which the previous
> 1141     // range ended, and adjust the start address so we don't try to free
> 1142     // the same region again. If the current range is entirely within that
> 1143     // region, skip it.
> 1144     if ((prev_last_region != NULL) && (start_region == prev_last_region)) {
> 1145       start_address = start_region->end();
> 1146       if (start_address > last_address) {
> 1147         continue;
> 1148       }
> 1149       start_region = _hrm.addr_to_region(start_address);
> 1150     }
> 
> How could the situation mentioned in line 1140 happen? Are the given
> memory regions not overlapping already, and the start addresses of these
> MemRegions at the start of these regions?

Probably because of using the same memory mapped file created from a VM
with different (smaller) heap region size?

Thanks,
  Thomas





More information about the hotspot-gc-dev mailing list