Can we run ZGC without tmpfs/hugeltbfs

Per Liden per.liden at oracle.com
Fri Jun 28 02:33:06 UTC 2019


Hi Sundar,

On 2019-06-28 01:12, Sundara Mohan M wrote:
> Hi,
>    Just started learning about ZGC and trying it out. My understanding was
> it uses tmpfs so that it access use LargePages from OS automatically.

Not quite. When using large pages (-XX:+UseLargePage), ZGC uses 
hugetlbfs. When using normal pages (the default), ZGC uses tmpfs. When 
using transparent huge pages (-XX:+UseLargePages 
-XX:+UseTranspatentHugePages), ZGC uses tmpfs.

> 
> Since i have my tmpfs size is smaller than my heap size, it is giving
> warning message when i start jvm with ZGC. To overcome this i have to
> provide ZPath which requires mounting hugetlbfs.
> 
> Questions
> 1. Is there a way to start ZGC without tmpfs/hugetlbfs?

ZGC currently requires a tmpfs or a hugetlbfs, but if you're running on 
a linux kernel which has the memfd_create() syscall (>= 3.17 for tmpfs, 
and >= 4.14 for hugetlbfs) then this is completely transparent to the 
user. If you are on an old kernel, then you might need to mount a 
filesystem and use -XX:ZPath.

> 2. Is there any other tuning variables other than Concurrent or Parallel GC
> threads or Memory?

There are a few. You can do:

java -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions 
-XX:+PrintFlagsFinal

and look for flags starting with "Z". You rarely need to use any of them 
though.

> 3. is enabling LargePage support mandatory? what is the impact if we dont
> enable it?

It's not mandatory and it's not enabled by default. Large pages is only 
used if you explicitly enable it using -XX:+UseLargePages.

> 
> Please point me in the right direction to learn more about ZGC and
> techniques used in this (memory mapping/huge pages specific to ZGC).

The ZGC wiki has information covering this topic:

https://wiki.openjdk.java.net/display/zgc/Main

cheers,
Per

> 
> Thanks
> Sundar
> 


More information about the zgc-dev mailing list