Forum Stats

  • 3,875,465 Users
  • 2,266,926 Discussions
  • 7,912,225 Comments

Discussions

How to extract a flight recording (.jfr) from a heap dump (.hprof)

user1149220
user1149220 Member Posts: 1
edited May 22, 2019 9:07AM in Java Mission Control

Hi Java Flight Recorder team,

is it possible to extract a recording (.jfr file) from a heap dump (.hprof)?

This would be terrific.

Best regards & keep up the great work.

Josef

Best Answer

  • Hirt-Oracle
    Hirt-Oracle Member Posts: 268
    edited Nov 6, 2018 8:57AM Answer ✓

    I see now that your question is the other way around, and that is not possible either. Most of the JFR events are recorded into thread local native buffers. When those are full, they are copied to a ring of native buffers. That said, at Oracle support, they can extract recording information from a crash dump (not hprof though).

Answers

  • Hirt-Oracle
    Hirt-Oracle Member Posts: 268
    edited Nov 6, 2018 8:55AM

    No. A hprof dump is a separate binary format representing the full contents of the Java heap. You can use JMC to perform heap dumps. Though be careful with heap dumps - a heap dump contains all the information on the heap, and due care must be taken with them if produced from a production system. A wayward heap dump containing all of the information about your customers and their businesses is enough to destroy YOUR business...

    JFR contains a representation of what the JVM and the application running on the JVM were up to, but they do not contain a full representation of all the objects on the heap. If they would the recordings would be significantly larger, and the overhead of producing them would be much larger as well.

  • Hirt-Oracle
    Hirt-Oracle Member Posts: 268
    edited Nov 6, 2018 8:57AM Answer ✓

    I see now that your question is the other way around, and that is not possible either. Most of the JFR events are recorded into thread local native buffers. When those are full, they are copied to a ring of native buffers. That said, at Oracle support, they can extract recording information from a crash dump (not hprof though).