-
Bug
-
Resolution: Fixed
-
P3
-
8-shenandoah, 11-shenandoah, 12, 13
-
b12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8220604 | 12.0.2 | Aleksey Shipilev | P3 | Resolved | Fixed | b01 |
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.
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).
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.
- backported by
-
JDK-8220604 Shenandoah does not work with TransparentHugePages properly
-
- Resolved
-
- blocks
-
JDK-8220162 Shenandoah should not commit HugeTLBFS memory
-
- Resolved
-
- is blocked by
-
JDK-8220350 Refactor ShenandoahHeap::initialize
-
- Resolved
-
- relates to
-
JDK-8220162 Shenandoah should not commit HugeTLBFS memory
-
- Resolved
-
-
JDK-8213927 G1 ignores AlwaysPreTouch when UseTransparentHugePages is enabled
-
- Resolved
-