java.io.IOException: Heap dump is broken with visualvm 2.0.4
@thurka is already working on this.
Since Sep 16, 2020.
- Dominant language
- Java
- Stars
- 3.3k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Description
Opening a Oracle JDK 1.8_131 hprof file in the latest visualvm 2.0.4 results in the following error:

I have enabled console logging, so this is what I see:
INFO [org.graalvm.visualvm.heapdump.impl.HeapDumpView]: Failed to load heap dump
java.io.IOException: Heap dump is broken.
Tag 0x1c at offset 7535442102 has zero length.
at org.graalvm.visualvm.lib.jfluid.heap.HprofHeap.fillTagBounds(HprofHeap.java:1335)
at org.graalvm.visualvm.lib.jfluid.heap.HprofHeap.<init>(HprofHeap.java:161)
at org.graalvm.visualvm.lib.jfluid.heap.HeapFactory.createHeap(HeapFactory.java:105)
at org.graalvm.visualvm.lib.jfluid.heap.HeapFactory.createHeap(HeapFactory.java:73)
at org.graalvm.visualvm.heapviewer.HeapViewer.createHeap(HeapViewer.java:122)
at org.graalvm.visualvm.heapviewer.HeapViewer.<init>(HeapViewer.java:72)
[catch] at org.graalvm.visualvm.heapdump.impl.HeapDumpView$MasterViewSupport$1.run(HeapDumpView.java:138)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
I tried this with the older version i had - v2.0.2 and it just hangs here:

I then tried it with jvisualvm from an older Oracle JDK v1.8_161 and it parses fine:

Steps to reproduce
This is an end customers heapdump which I'm afraid I cannot share at the moment. I am still seeing if I can reproduce this issue on my local environment and make it available.
Expected behavior
Since it is evident that jvisualvm from 1.8_161 was able to open the heapdump, visualvm 2.0.4 could be made tolerant to this kind of heap inconsistency.
Eclipse MAT also has a strictness mode setting where we can toggle it between "Strict" and "Warning".

Keeping it to WARNING will parse this heapdump.
More on that in the eclipse bug here - https://bugs.eclipse.org/bugs/show_bug.cgi?id=404679
VisualVM log
v2.0.4_messages.log
v2.0.2_messages.log
jvisualvm_1.8_161_messages.log
Desktop (please complete the following information):
- Windows 10
- Version 2.0.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.