Profile Image

What is Java Archive Classes at Exit: -XX:AllocateHeapAt?

What is Java Archive Classes at Exit: -XX:AllocateHeapAt? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-allocateheapat

  • x-allocateheapat

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky



• -XX:AllocateHeapAt=<filename>




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.


Default Value:

-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

Related Posts:

• Java Support for Intel Optane DC Persistent Memory: an example of
an alternative non-volatile memory device that can be used with the
-XX:AllocateHeapAt option.



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.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-allocateheapat

  • x-allocateheapat