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

LargePages silently falling back to small pages with G1GC & 8GB+ heaps

XMLWordPrintable

    • gc
    • x86_64
    • linux

        tFULL PRODUCT VERSION :
        java version "1.7.0_60"
        Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
        Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

        FULL OS VERSION :
        2.6.18 x86_64

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Huge pages are manually configured and works correctly with JDK 6 and up to JDK 7u55 (inclusive). Switching to 7u60 introduces the behavior of silently falling back

        A DESCRIPTION OF THE PROBLEM :
        Starting with 7u60 the combination of LargePages, G1GC, and a heap of 8GB or more causes the JVM to silently fall back to small pages.

        THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

        THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

        REGRESSION. Last worked in version 7u60

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Super simple code to just let the JVM hang out so you can go to another window and check the hugepages utilization:

        import javax.net.*;

        class Hello {
            public static void main(String[] argv) throws Exception {
                System.out.println("Hello!");
                Thread.sleep(1000000);
            }
        }

        Works up to 1MB below the 8GB mark:

        /apollo/env/BigBirdRequestRouterService/jdk/bin/java -Xms8191m -Xmx8191m -XX:+UseLargePages -XX:+AlwaysPreTouch -XX:+UseG1GC Hello
        Hello!

        (in another window)
        cat /proc/meminfo |grep Huge
        HugePages_Total: 8704
        HugePages_Free: 8694
        HugePages_Rsvd: 3622
        Hugepagesize: 2048 kB

        At 8GB (and higher) the hugepages just stop working and silently fall back to small pages:

        /apollo/env/BigBirdRequestRouterService/jdk/bin/java -Xms8191m -Xmx8191m -XX:+UseLargePages -XX:+AlwaysPreTouch -XX:+UseG1GC Hello

        cat /proc/meminfo |grep Huge
        HugePages_Total: 8704
        HugePages_Free: 8696
        HugePages_Rsvd: 0
        Hugepagesize: 2048 kB


        However if I remove UseG1GC but leave the 8GB heap, it uses the huge pages:

        java -Xms8g -Xmx8g -XX:+UseLargePages -XX:+AlwaysPreTouch Hello
        Hello!

        cat /proc/meminfo |grep Huge
        HugePages_Total: 8704
        HugePages_Free: 4596
        HugePages_Rsvd: 160
        Hugepagesize: 2048 kB


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        I expect the huge/large pages to be used even with G1GC and a heap of 8GB+
        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        No errors, it silently falls back.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        See reproduction steps
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        I haven't been able to find one.

              stefank Stefan Karlsson
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: