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

Dump JFR recording on ExitOnOutOfMemoryError

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • tbd
    • 11, 12
    • hotspot
    • None
    • jfr

      If a user has specified -XX:+ExitOnOutOfMemoryError, Flight Recorder doesn't dump a recording.

      It is difficult to use the normal mechanism and write the recording in the shutdown hook, since there is no more Java memory. Furthermore, a user may want the JVM to exit as fast as possible to minimize the risk of data corruption. Also, the Epsilon GC sets ExitOnOutOfMemoryError and a user may not want recording on their hard disk everytime the JVM exits.

      It is probably wise to only dump a recording if a user has specified XX:StartFlightRecording:dumponexit=true (which is implicitly set by -XX:StartFlightRecording:filename=<filename>). This in contrast to a crash, where a emergency dump is written regardless if a user has specified dumponexit=true or not.

      If a recording is dumped, Old Object sample events should be written, so a user have information to solve any potential Java memory leak

        1. hs_err_pid4390.jfr
          398 kB
        2. hs_err_pid4390.log
          76 kB
        3. OOME.java
          0.2 kB

            Unassigned Unassigned
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: