JDK-8211425 : Allocation of old generation of java heap on alternate memory devices - G1 GC
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-10-03
  • Updated: 2019-11-07
  • Resolved: 2018-12-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12 JDK 13
12 b26Fixed 13Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
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.
Comments
The parent CR (JDK-8202286) is approved for jdk12 late enhancement.
21-12-2018

Latest webrev: http://cr.openjdk.java.net/~kkharbas/8211425/webrev.18
21-12-2018