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

Parallel GC does not pre-touch all heap pages when AlwaysPreTouch enabled and large page disabled

    XMLWordPrintable

Details

    • gc
    • 19
    • b09
    • generic
    • generic

    Backports

      Description

        AlwaysPreTouch requires all freshly committed pages to be pre-touched. While currently PS GC does not pre-touch heap pages with -XX:+AlwaysPreTouch.
        This issue is related to JDK-8315923, which fixes it when huge pages are used. But the bug still stands if regular page are used. For example, on linux we can reproduce this bug when /sys/kernel/mm/transparent_hugepage/enabled is madvise or never, but cannot reproduce when it is always.

        A simple way to reproduce, please make sure large pages are NOT used.
        Just run a test with the following parameters
        -XX:+AlwaysPreTouch -Xms31g -Xmx31g -XX:+UseParallelGC
        There is no pre-touching during heap initialing stage. After initialization, RSS of the test process is much smaller than memory committed.
        On the contrary, using -XX:+UseG1GC and run the test again
        -XX:+AlwaysPreTouch -Xms31g -Xmx31g -XX:+UseG1GC
        it takes several seconds to pre-touch heap pages during initialization, and RSS usage after initialization is similar to memory committed. This is the expected behavior of AlwaysPreTouch

        This issue related to JDK-8283935, which uses alignment() instead of os::vm_page_size() as pre-touching step size. The value of alignment() is usually bigger than OS page size, which causes most heap pages are not pre-touched.

        Attachments

          Issue Links

            Activity

              People

                wzhuo Wang Zhuo
                wzhuo Wang Zhuo
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: