413
The existing heap-related flags such as -Xmx, -Xms, and garbage collection–related
flags will continue to work as before. For example:
$ java –Xmx32g –Xms16g –XX:AllocateHeapAt=/pmemfs/jvmheap \
ApplicationClass
This allocates an initial 16GiB heap size (-Xms) with a maximum heap size up to
32GiB (-Xmx32g). The JVM heap can use the capacity of a temporary file created within
the path specified by --XX:AllocateHeapAt=/pmemfs/jvmheap. JVM automatically
creates a temporary file of the form jvmheap.XXXXXX, where XXXXXX is a randomly
generated number. The directory path should be a persistent memory backed file system
mounted with the DAX option. See Chapter 3 for more information about mounting file
systems with the DAX feature.
To ensure application security, the implementation must ensure that file(s) created
in the file system are:
• Protected by correct permissions, to prevent other users from
accessing it
• Removed when the application terminates, in any possible scenario
The temporary file is created with read-write permissions for the user running the
JVM, and the JVM deletes the file before terminating.
This feature targets alternative memory devices that have the same semantics as DRAM,
including the semantics of atomic operations, and can therefore be used instead of DRAM for
the object heap without any change to existing application code. All other memory structures
such as the code heap, metaspace, thread stacks, etc., will continue to reside in DRAM.
Some use cases of this feature include
• In multi-JVM deployments, some JVMs such as daemons, services,
etc., have lower priority than others. Persistent memory would
potentially have higher access latency compared to DRAM. Lowpriority processes can use persistent memory for the heap, allowing
high-priority processes to use more DRAM.
• Applications such as big data and in-memory databases have an
ever-increasing demand for memory. Such applications could use
persistent memory for the heap since persistent memory modules
would potentially have a larger capacity compared to DRAM.
Appendix d JAvA for persistent MeMory
Précédent

- 433/457

Suivant