Relates :
|
This experimental feature in G1 and Parallel GC allows them to allocate the old generation of the Java heap on an alternative memory device such as NV-DIMM memory. Operating systems today expose NV-DIMM memory devices through the file system. Examples are NTFS DAX mode and ext4 DAX mode. 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 specification of a path to an NV-DIMM file system by using the flag `-XX:AllocateOldGenAt=<path>` enables this feature. There is no additional flag to enable this feature. When enabled, young generation objects are placed in DRAM only while old generation objects are always allocated in NV-DIMM. At any given point, the collector guarantees that the total memory committed in DRAM and NV-DIMM memory is always less than the size of the heap as specified by `-Xmx`. The current implementation pre-allocates the full Java heap size in the NV-DIMM file system to avoid problems with dynamic generation sizing. Users need to make sure there is enough free space on the NV-DIMM file system. When enabled, the VM also limits the maximum size of the young generation based on available DRAM, although it is recommended that users set the maximum size of the young generation explicitly. For example, if the VM is run with `-Xmx756g` on a system with 32GB DRAM and 1024GB NV-DIMM memory, the collector will limit the young generation size based on following calculation: 1. No `-XX:MaxNewSize` or `-Xmn` is specified: the maximum young generation size is set to 80% of available memory (25.6GB). 2. `-XX:MaxNewSize` or `-Xmn` is specified: the maximum young generation size is capped at 80% of available memory (25.6GB) regardless of the amount specified. 3. Users can use `-XX:MaxRAM` to let the VM know how much DRAM is available for use. If specified, maximum young gen size is set to 80% of the value in MaxRAM. 4. Users can specify the percentage of DRAM to use (instead of the default 80%) for young generation with `-XX:MaxRAMPercentage`. Enabling logging with the logging option `gc+ergo=info` will print the maximum young generation size at startup.