[lworld] RFR: 8267697: [lworld] [lw3] VM crashes during heap dump if Java heap contains flat arrays
Alex Menkov
amenkov at openjdk.java.net
Wed Sep 8 23:23:39 UTC 2021
Updated HeapDumper to generate HPROF_GC_INSTANCE_DUMP records for inlined objects (flattened fields and flattened arrays).
Field values of the inlined objects are read directly from container object/array
HPROF_GC_INSTANCE_DUMP record requires unique object ID (for identity objects address of the oop is used).
To generate it InlinedObjectSupport class is implemented which generates ID as 1,2,3,...
The idea is to write inlined objects in 2 pass:
- save state of DumpWriter::inlined_object_support;
- 1st pass (dumping parent object instance fields or array elements): write inlined object ids (generated by DumpWriter::inlined_object_support);
- 2nd pass: generate HPROF_GC_INSTANCE_DUMP record for inlined objects using ids from saved inlined_object_support.
2nd pass works the same way as dumping of parent object, so if inlined objects contain inlined fields HPROF_GC_INSTANCE_DUMP records will be generated for them after dumping of parent object is completed. The process is repeated recursively for all levels of inlined fields nesting.
-------------
Commit messages:
- Updated heapDumper to support inlined objects
Changes: https://git.openjdk.java.net/valhalla/pull/548/files
Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=548&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8267697
Stats: 671 lines in 3 files changed: 631 ins; 3 del; 37 mod
Patch: https://git.openjdk.java.net/valhalla/pull/548.diff
Fetch: git fetch https://git.openjdk.java.net/valhalla pull/548/head:pull/548
PR: https://git.openjdk.java.net/valhalla/pull/548
More information about the valhalla-dev
mailing list