Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8220153

Shenandoah does not work with TransparentHugePages properly

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b12

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shade Aleksey Shipilev
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: