Introduce "region type" field to G1 HeapRegions

Tony Printezis tprintezis at twitter.com
Fri Sep 5 21:31:11 UTC 2014


Hi all,

One of the things that has always annoyed me in G1 is that working out 
the type of a heap region is a complete mess:

- there are separate fields for "humongous type" and "young type"
- to check whether a region is free we have to check is_empty()
- we cannot explicitly check whether a region is old (if it's none of 
the other types, then it's old)

If anyone wants to add new region types (as we all seem to want to do 
these days!!!), doing so is a bit of a pain and more error-prone than it 
should be. Could I ask you to consider the following patch that 
introduces a HeapRegionType class, which encapsulates all the region 
type information, and replaces the young / humongous type fields with 
HeapRegionType _type?

http://cr.openjdk.java.net/~tonyp/g1-region-type/webrev.0/

I've again done as much testing as I could here but more would be 
appreciated. Let me know if this change will be of interest and I'll 
create a CR.

Regards,

Tony

-- 
Tony Printezis | JVM/GC Engineer / VM Team | Twitter

@TonyPrintezis
tprintezis at twitter.com




More information about the hotspot-gc-dev mailing list