Enabling use of hugepages with java

Richard Achmatowicz rachmato at redhat.com
Wed Feb 28 15:20:22 UTC 2018


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?

Thanks in advance

Richard



More information about the jdk-dev mailing list