jmap with -F flag fails due to "AssertionFailure: Expecting GenCollectedHeap, G1CollectedHeap, or ParallelScavengeHeap, but got sun.jvm.hotspot.gc_interface.CollectedHeap"

Solution Verified - Updated -

Issue

  • jmap fails to capture a heap dump from a 1.7.0_25 OpenJDK jvm with the following error:
$ /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64/bin/jmap -J-d64 -dump:format=b,file=heap.hprof -F 3069
Attaching to process ID 3069, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 23.7-b01
Dumping heap to heap.hprof ...
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.tools.jmap.JMap.runTool(JMap.java:197)
    at sun.tools.jmap.JMap.main(JMap.java:128)
Caused by: sun.jvm.hotspot.utilities.AssertionFailure: Expecting GenCollectedHeap, G1CollectedHeap, or ParallelScavengeHeap, but got sun.jvm.hotspot.gc_interface.CollectedHeap
    at sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
    at sun.jvm.hotspot.oops.ObjectHeap.collectLiveRegions(ObjectHeap.java:605)
    at sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:244)
    at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:51)
    at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:416)
    at sun.jvm.hotspot.tools.HeapDumper.run(HeapDumper.java:56)
    at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
    at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:77)
    ... 6 more
  • Heap dump error on Openshift

Environment

  • Red Hat Enterprise Linux 6
    • OpenJDK 1.6.0_30
    • OpenJDK 1.7.0_25
    • OpenJDK Runtime Environment (IcedTea6 1.13.1) (rhel-3.1.13.1.el6_5-x86_64)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content