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

JFR memory leak

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 11.0.7, 15
    • hotspot
    • None
    • jfr
    • generic
    • generic

      On behalf of Ekaterina Vergizova (katya@azul.com):

      The leak is jdk.jfr.internal.TypeLibrary keeps on holding to jdk.jfr.internal.PlatformEventType instances even when the underlying classes are unloaded.
      This can for example happen when you redeploy a web application that contains custom JFR events.

      To reproduce run the attached jar with the following command line arguments:
      java -Xmx64m -Xms64m -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=64m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseSerialGC -jar jfr-leaker-0.1.0-SNAPSHOT.jar

      The heap and metaspace sizes are limited to have the OutOfMemoryError happen earlier. The error also happens with bigger sizes, it just takes longer.
      SerialGC is used because of the small heap size, but the bug also happens with other GCs.

      The source code can be found here: https://github.com/marschall/jfr-leaker

            Unassigned Unassigned
            bae Andrew Brygin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: