I just learned Java Mission Control. I thought about how to make Java Flight Recorder with Java code. I analyzed the heap file with lots of different tools, but this time I want to do it with code.
Asked
Active
Viewed 894 times
0
-
Are you asking how to decompile something (heap file?) into Java source code? Your question isn't clear. – Scott Smith Feb 07 '19 at 22:11
-
@ScottSmith Yes, you got it right !!! – Mike Wheatstone Feb 11 '19 at 10:05
-
Is it a .jfr file you want to analyze? – Klara Feb 21 '19 at 08:18
-
@Klara it can be .jfr or .bin or .hprof. – Mike Wheatstone Feb 25 '19 at 10:34
1 Answers
2
Here are the docs for reading a .jfr file with Java 11 - https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jfr/jdk/jfr/consumer/package-summary.html
There are other (not as supported) APIs for reading older .jfr files (from JDK 8), both with the JFR parser built into the JDK, and the JFR parser built into Java Mission Control.

Klara
- 2,935
- 22
- 19
-
JMC has a parser for hprof files, but it is only used internally. I assume there are other open source projects that have hprof parsers, maybe this one?: https://github.com/eaftan/hprof-parser – Klara Mar 12 '19 at 08:25