Blocks :
|
|
Blocks :
|
|
Relates :
|
|
Relates :
|
Take this: public class Hello { public static void main(String... args) throws Throwable { System.out.println("Hello World"); System.in.read(); } } Config system to accept THP: $ cat /sys/kernel/mm/transparent_hugepage/{enabled,defrag} always [madvise] never always defer defer+madvise [madvise] never Run with: $ java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx100g -Xms100g -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages Hello Observe heap mapping in /proc/$pid/smaps: 7fd958000000-7ff2bc000000 rw-p 00000000 00:00 0 Size: 106496000 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 315712 kB Pss: 315712 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 315712 kB Referenced: 315712 kB Anonymous: 315712 kB LazyFree: 0 kB AnonHugePages: 0 kB ShmemPmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB VmFlags: rd wr mr mw me ac sd It is not really committed (RSS/PSS is low), and no THP is used (AnonHugePages is zero). JDK-8213927 fixed the similar issue in G1, we need to fix it in Shenandoah as well. On one hand, this is AlwaysPreTouch problem, but we also have to communicate heap alignment to heap reservation code to use any flavor of large pages.
|