2

I acquired a heap dump from a OpenJ9 java application using the command

jcmd <pid> GC.heap_dump

Then I open it on Eclipse Memory Analyzer to check a specific class, but when I tried to see the content of a byte array attribute of this class all the bytes appear as zero.

I tried looking to other byte array references, but all of them are the same.

Is there a way to see it content with the file that I have or I need to generate the heap dump in a different way?

1 Answers1

3

In a heap dump, all primitive-type fields are cleared intentionally so customers are not sending sensitive data to service providers for analysis.

If you want to examine such data yourself, use jcmd Dump.system together with the extension to Eclipse Memory Analyzer for reading system dumps. You can find instructions for adding that extension at https://www.eclipse.org/openj9/docs/dump_systemdump/.

  • Do I need to pass any parameter to VM to get the dump in that way? I tried `jcmd 1 GC.heap_dump Dump.system` but the result was de same; tried run the JVM with the flag -Xdump it didn't work either – Anderson Fachini Jan 08 '20 at 12:15
  • Now I found the way `jcmd 1 Dump.system teste.system`. Thank you very much. (I found more examples here https://www.eclipse.org/openj9/docs/tool_jcmd) – Anderson Fachini Jan 08 '20 at 12:46
  • Including the character data of strings? That would reduce the usefulness of a heap dump dramatically. – Holger Jan 09 '20 at 14:13
  • Did you succeed getting data? I am hitting the same problem. – kyberorg Jun 16 '21 at 14:15