HeapDumper has some static fields/methods to keep pointer to active dumper instance implementing callback functions:
static VM_HeapDumper* _global_dumper;
static DumpWriter* _global_writer;
DumpWriter* _local_writer;
static VM_HeapDumper* dumper();
static DumpWriter* writer();
Most callbacks are now implemented as closures, the only remaining callback function is do_load_class to generate HPROF_LOAD_CLASS records.
Also do_load_class() has an issue:
it uses static u4 class_serial_num variable to generate class serial numbers, but the value is never reset, so for the 1st heap dumpt serial numbers start from 1, and for following dumps serial numbers become bigger and bigger.
Serial numbers are used as an index in klass_map array, so for each heap dump the array requires more and more memory.
Also after overflow we get 0 as serial number (per spec the value should be > 0)
static VM_HeapDumper* _global_dumper;
static DumpWriter* _global_writer;
DumpWriter* _local_writer;
static VM_HeapDumper* dumper();
static DumpWriter* writer();
Most callbacks are now implemented as closures, the only remaining callback function is do_load_class to generate HPROF_LOAD_CLASS records.
Also do_load_class() has an issue:
it uses static u4 class_serial_num variable to generate class serial numbers, but the value is never reset, so for the 1st heap dumpt serial numbers start from 1, and for following dumps serial numbers become bigger and bigger.
Serial numbers are used as an index in klass_map array, so for each heap dump the array requires more and more memory.
Also after overflow we get 0 as serial number (per spec the value should be > 0)
- links to
-
Commit(master) openjdk/jdk/03149735
-
Review(master) openjdk/jdk/21216