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

InitialBootClassLoaderMetaspaceSize and CompressedClassSpaceSize should be checked consistent from MaxMetaspaceSize

XMLWordPrintable

    • b31

        I booted Tomcat 8 with "-XX:MaxMetaspaceSize=5m -XX:+PrintGCDetails", but it failed.
        I checked GC log, Java heap and Metaspace was NOT exhausted.

        ------------
        [Full GC (Last ditch collection) [Tenured: 1049K->1049K(10944K), 0.0050992 secs] 1049K->1049K(15936K), [Metaspace: 4871K->4871K(1056768K)], 0.0051411 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
        [Full GC (Metadata GC Threshold) [Tenured: 1049K->1049K(10944K), 0.0050587 secs] 1049K->1049K(15936K), [Metaspace: 4871K->4871K(1056768K)], 0.0051023 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
        [Full GC (Last ditch collection) [Tenured: 1049K->1049K(10944K), 0.0050200 secs] 1049K->1049K(15936K), [Metaspace: 4871K->4871K(1056768K)], 0.0050613 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]

        Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
        ------------

        My environment:
             Fedora22 x86_64
              - kernel-4.0.4-303.fc22.x86_64
              - glibc-2.21-5.fc22.x86_64
              - java-1.8.0-openjdk-1.8.0.45-39.b14.fc22.x86_64
              - apache-tomcat-8.0.23

        The Compressed ClassSpace is a part of Metaspace.
        The size of the Compressed ClassSpace is included in the comparison with MaxMetaspaceSize only
        when the space is committed [1].
        However, users cannot know their incorrect parameter(s) until memory space will be committed.

        Compressed ClassSpace is continuous memory space, and its default value is 1GB.
        In case of Linux, it affects overcommit memory. It will be cause of OOM-killer at the worst case.

        So I want to alert inconsistency metaspace setting at early as possible.


        [1] http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2015-June/013817.html

              ysuenaga Yasumasa Suenaga
              ysuenaga Yasumasa Suenaga
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: