412
Heap Allocation on Alternative Memory Devices
Both Oracle JDK v10 and OpenJDK v10 implemented JEP 316: Heap allocation on
alternative memory devices [http://openjdk.java.net/jeps/316]. The goal of this
feature is to enable the HotSpot VM to allocate the Java object heap on an alternative
memory device, such as persistent memory, specified by the user.
As described in Chapter 3, Linux and Windows can expose persistent memory
through the file system. Examples are NTFS and XFS or ext4. Memory-mapped files
on these direct access (DAX) file systems bypass the page cache and provide a direct
mapping of virtual memory to the physical memory on the device.
To allocate the Java heap using memory-mapped files on a DAX file system, Java
added a new runtime option, -XX:AllocateHeapAt=. This option takes a path
to the DAX file system and uses memory mapping to allocate the object heap on the
memory device. Using this option enables the HotSpot VM to allocate the Java object
heap on an alternative memory device, such as persistent memory, specified by the user.
The feature does not intend to share a non-volatile region between multiple running
JVMs or reuse the same region for further invocations of the JVM.
Figure D-1 shows the architecture of this new heap allocation method using both
DRAM and persistent memory backed virtual memory.
The Java heap is allocated only from persistent memory. The mapping to DRAM is
shown to emphasize that non-heap components like code cache, gc bookkeeping, and
so on, are allocated from DRAM.
Figure D-1. Java heap memory allocated from DRAM and persistent memory
using the “-XX:AllocateHeapAt=” option
Appendix d JAvA for persistent MeMory
Heap Allocation on Alternative Memory Devices
Both Oracle JDK v10 and OpenJDK v10 implemented JEP 316: Heap allocation on
alternative memory devices [http://openjdk.java.net/jeps/316]. The goal of this
feature is to enable the HotSpot VM to allocate the Java object heap on an alternative
memory device, such as persistent memory, specified by the user.
As described in Chapter 3, Linux and Windows can expose persistent memory
through the file system. Examples are NTFS and XFS or ext4. Memory-mapped files
on these direct access (DAX) file systems bypass the page cache and provide a direct
mapping of virtual memory to the physical memory on the device.
To allocate the Java heap using memory-mapped files on a DAX file system, Java
added a new runtime option, -XX:AllocateHeapAt=
to the DAX file system and uses memory mapping to allocate the object heap on the
memory device. Using this option enables the HotSpot VM to allocate the Java object
heap on an alternative memory device, such as persistent memory, specified by the user.
The feature does not intend to share a non-volatile region between multiple running
JVMs or reuse the same region for further invocations of the JVM.
Figure D-1 shows the architecture of this new heap allocation method using both
DRAM and persistent memory backed virtual memory.
The Java heap is allocated only from persistent memory. The mapping to DRAM is
shown to emphasize that non-heap components like code cache, gc bookkeeping, and
so on, are allocated from DRAM.
Figure D-1. Java heap memory allocated from DRAM and persistent memory
using the “-XX:AllocateHeapAt=
Appendix d JAvA for persistent MeMory
