[lworld] RFR: 8267697: [lworld] [lw3] VM crashes during heap dump if Java heap contains flat arrays
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.
- Updated heapDumper to support inlined objects
Stats: 671 lines in 3 files changed: 631 ins; 3 del; 37 mod
Fetch: git fetch https://git.openjdk.java.net/valhalla pull/548/head:pull/548
More information about the valhalla-dev