JEP draft: Allocation of Old generation of Java Heap on alternate memory devices.

AuthorsKishor Kharbas, Vinay Awasthi
OwnerKishor Kharbas
TypeFeature
ScopeJDK
StatusDraft
Componenthotspot / gc
EffortM
DurationM
Created2018/04/25 23:29
Updated2018/06/12 19:08
Issue8202286

Summary

Enable an experimental feature in HotSpot JVM to allocate old generation of Java heap on an alternative memory device, such as NV-DIMM, specified by the user.

Goals

The goal of this feature is to facilitate exploration of different use cases for new memory technologies with the possibility of dramatically large heap sizes at increased cost efficiencies.

Motivation

With the availability of cheap NV-DIMM memory, future systems may be equipped with a heterogeneous memory architecture. Such an architecture, in addition to DRAM, will have one or more types of non-DRAM memory with different characteristics. NV-DIMMs such as Intel Persistent Memory are projected to have higher capacity as compared to DRAM. Java applications would like to take advantage of this capacity. The motivation behind this JEP is to provide an experimental feature to facilitate exploration of different use cases for these non-DRAM memories.

Description

Operating systems today expose NV-DIMM memory devices through the file system. Examples are NTFS DAX mode and ext4 DAX. Memory-mapped files in these file systems bypass the file cache and provide a direct mapping of virtual memory to the physical memory on the device.

The idea is to allocate part of Heap memory in NV-DIMM and use it exclusively for old generation objects. The rest of the heap is mapped to DRAM and young generation objects are always placed here. This implementation would add a new experimental option, -XX:AllocateOldGenAt=<path>.AllocateOldGenAt` takes a path to the file system where the device is mounted, and use it to create a temporary, nameless file to map part of heap to NV-DIMM. GCs to be supported are: G1, ParallelScavenge, and Serial.

Testing

At a higher level we need to test:

  1. Correct mapping of Old generation to specified NV-DIMM device and correct placement of young/old objects in corresponding memory spaces.
  2. No regression when this feature is not used.
  3. File which is created to map memory to NV-DIMM is protected by corrected permissions and ceases to exist on different termination conditions such as graceful termination, power failure, system shutdown, etc.

Details and other implementation specific tests are covered in the test plan.