java -XX:AllocateHeapAt=/mnt/pmem1 -Xmx128g
The -XX:AllocateHeapAt option can be used to allocate the Java heap on a
non-standard memory device such as non-volatile DIMM (NVDIMM).
On systems that support it, such memory devices may be mounted in the
filesystem, and the -XX:AllocateHeapAt option can be used to point the JVM
at the path of the mounted memory device. In this way, the Java heap will be
created in the special memory device rather than in the normal DRAM.
This feature is only available on JDK 11 and above and on systems that have
hardware and OS support for non-standard memory devices.
-XX:AllocateHeapAt is undefined by default, meaning the Java heap will be
allocated in the normal DRAM memory of the computer.
If the specified path is not a supported memory device, then the JVM will print
an error and exit:
OpenJDK 64-Bit Server VM warning: Could not create file for heap
with template /mnt/pmem1/jvmheap.kWgeDT
Error occurred during initialization of VM
Could not create file for Heap at location /mnt/pmem1
Arguments Related to -XX:AllocateHeapAt:
TODO: link to -Xmx TODO: link to -XX:AllocateOldGenAt
• Java Support for Intel Optane DC Persistent Memory: an example of
an alternative non-volatile memory device that can be used with the
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your
insights will help the entire 10+ million java developer community to develop
one standard source of documentation for all the JVM arguments.
Edit your Comment