0

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?

Horcrux7
  • 23,758
  • 21
  • 98
  • 156

2 Answers2

1

reference: https://github.com/eclipse-openj9/openj9/issues/6593

tldr - 2 options:

Gireesh Punathil
  • 1,344
  • 8
  • 18
  • The MAT show me the error message: "Not a HPROF heap dump (java.io.IOException)" if I try to open a phd file. What I do wrong? – Horcrux7 Jul 22 '22 at 07:05
  • How can I use hprof agent with OpenJ9? The link is related to the Hotpsot VM and not the OpenJ9. – Horcrux7 Jul 22 '22 at 07:11
0

If you use the dumpAgent heap then it create a *.phd file (portable heap dump). If you want analyze it with Eclipse MAT then you need to install the IBM Monitoring and Diagnostic Tools plugin.

The update site ist: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/

For Details: https://www.artificialworlds.net/blog/2016/02/23/how-to-analyse-a-phd-heap-dump-from-an-ibm-jvm/

Horcrux7
  • 23,758
  • 21
  • 98
  • 156