I try to create a heap dump with a OpenJ9 Java VM via API that is compatible with a heap dump from a Hotspot Java VM and can be use with the same analyzer tools.
I use the follow code:
Class<PlatformManagedObject> clazz = (Class)Class.forName( "openj9.lang.management.OpenJ9DiagnosticsMXBean", null );
PlatformManagedObject openj9MBean = ManagementFactory.newPlatformMXBeanProxy( server, "openj9.lang.management:type=OpenJ9Diagnostics", clazz );
Method triggerDumpToFile = clazz.getMethod( "triggerDumpToFile", String.class, String.class );
triggerDumpToFile.invoke( openj9MBean, dumpAgent, file.getAbsolutePath() );
I try all 4 values for dumpAgent (java, snap, system and heap) but the output format is not in the *.hprof file format.
Are there other options?