Enabling use of hugepages with java
stefan.karlsson at oracle.com
Tue Mar 6 08:30:33 UTC 2018
On 2018-02-28 23:04, David Holmes wrote:
> Hi Richard,
> Moving to hotspot-dev as the appropriate list.
> On 1/03/2018 1:20 AM, Richard Achmatowicz wrote:
>> 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
>> 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:
"If you are using the option -XX:+UseSHM (instead of
-XX:+UseHugeTLBFS), then increase the SHMMAX value."
>> Thanks in advance
More information about the jdk-dev