Null Pointer exception when extracting dump from core file with Java 11
Issue
- Cannot extract heap dump from core file with Java 11, using the following command:
$JAVA_HOME/bin/jhsdb jmap --exe $JAVA_HOME/bin/java --core /var/core/core.file --binaryheap --dumpfile heap.hprof
, which gives NullPointerException
:
Attaching to core /var/core/core.file from executable $JAVA_HOME/bin/java, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 11.0.4+11-LTS
Exception in thread "main" java.lang.NullPointerException
at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeSymbolID(HeapHprofBinWriter.java:1121)
at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.dumpStackFrame(HeapHprofBinWriter.java:752)
at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.dumpStackTraces(HeapHprofBinWriter.java:725)
at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:434)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176)
at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:318)
at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:477)
Environment
- OpenJDK 11
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.