Enabling use of hugepages with java (original) (raw)
Stefan Karlsson stefan.karlsson at oracle.com
Tue Mar 6 08:30:33 UTC 2018
- Previous message: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down using -Xcheck:jni and java.util.zip.DeflaterOutputStream
- Next message: [8u] RFR for backport of JDK-8026331: hs_err improvement: Print if we have seen any OutOfMemoryErrors or StackOverflowErrors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Richard,
On 2018-02-28 23:04, David Holmes wrote:
Hi Richard,
Moving to hotspot-dev as the appropriate list. David On 1/03/2018 1:20 AM, Richard Achmatowicz wrote: Hi
I hope that I am directing this question to the correct mailing list. I have a question concerning the OS setup on Linux required for correct use of the java option -XX:+UseLargePages in JDK 8. Official Oracle documentation (http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html) suggests that in order to make use of large memory pages, in addition to setting the flag -XX:+UseLargePages, an OS option shmmax needs to be tuned to be larger than the java heap size. From looking at the java documentation, there are various ways of enabling the use of huge pages: -XX:+UseHugeTLBFS, -XX:+UseTransparentHugePages, -XX:+UseSHM and, if I understand correctly, these correspond in part to making use of different OS-level APIs for accessing huge pages (via shared memory, hugetlbfs, and other means). My question is this: is setting the shmmax OS value only relevant if we are using -XX:+UseSHM? In other words, if we are using -XX:+UseHugeTLBFS to enable use of hugepages by the JVM, is it the case that setting the shmmax OS setting has no effect on the use of hugepages by the JVM?
Yes, your understanding is correct.
The document you link to seems to be from a time before -XX:+UseHugeTLBFS was added.
This document clarifies this a bit more: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#large_pages
"If you are using the option -XX:+UseSHM (instead of -XX:+UseHugeTLBFS), then increase the SHMMAX value."
Cheers, StefanK
Thanks in advance Richard
- Previous message: GetPrimitiveArrayCritical vs GetByteArrayRegion: 140x slow-down using -Xcheck:jni and java.util.zip.DeflaterOutputStream
- Next message: [8u] RFR for backport of JDK-8026331: hs_err improvement: Print if we have seen any OutOfMemoryErrors or StackOverflowErrors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]