Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
This is sub-task for implementing the feature (JDK-8202286) for G1 GC. Following text describes the design: G1 divides the reserved heap space into regions; a region can end up as old, young or humongous. Thus old generation is not a range of memory address, its a collection of regions which are spread throughout the heap. An option is to map a region to the corresponding physical memory (dram or nv-dimm) based on how its being used. However this will involve page re-mapping which are proven to be costly due to tlb miss penalties. To avoid this, we need non-overlapping reserved memories for old and young regions. We reserve 2*Xmx memory; Xmx memory for young regions and remaining Xmx memory for old regions. We create a sub-class of HeapRegionManager called 'HeapRegionManagerForHeteroHeap' which manages regions which are physically backed by DRAM and regions backed by NV-DIMM. HeapRegionManagerForHeteroHeap can be internally composed of HeapRegionManager for DRAM regions and HeapRegionManager for NV-DIMM regions (this conceptual composition does not need to be implemented as separate classes). This class overrides the api used by G1CollectedHeap to allocate new region, expand heap, allocate humongous regions, etc. This class maintains the invariant that total number of committed regions is less than current size of heap. E.g. if G1 needs more DRAM regions than available at a given point, unused regions from NV-DIMM have to be uncommitted so that new regions in DRAM can be committed.
|