RFR(XS) 8230674 Heap dumps should exclude dormant CDS archived objects

David Holmes david.holmes at oracle.com
Fri Sep 6 03:18:52 UTC 2019


Hi Ioi,

On 6/09/2019 12:27 pm, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8230674
> http://cr.openjdk.java.net/~iklam/jdk14/8230674-heap-dump-exclude-dormant-oops.v01 
> 
> 
> Please review this small fix:
> 
> When CDS is in use, archived objects are memory-mapped into the heap 
> (currently G1GC only). These objects are partitioned into
> "subgraphs". Some of these subgraphs may not be loaded (e.g., those
> related to jdk.internal.math.FDBigInteger) at the time a heap dump is
> requested. >
> When a subgraph is not loaded, some of the objects in this subgraph may 
> belong to a class that's not yet loaded.
> 
> The bug happens when such an "dormant" object is dumped, but its class
> is not dumped because the class is not in the system dictionary.
> 
> There is already code in DumperSupport::dump_instance() that tries to 
> handle dormant objects, but it needs to be extended to cover arrays, as well as 
> and references from non-dormant object/arrays to dormant ones.

I have to confess I did not pay any attention to the CDS archived 
objects work, so I don't have a firm grasp of how you have implemented 
things. But I'm wondering how can you have a reference to a dormant 
object from a non-dormant one? Shouldn't the act of becoming non-dormant 
automatically cause the subgraph from that object to also become 
non-dormant? Or do you have "read barriers" to perform the changes on 
demand?

That aside the code changes seem reasonable, you moved the check out of 
DumperSupport::dump_instance and into the higher-level 
HeapObjectDumper::do_object so that it catches instances and arrays, 
plus you added a check for array elements.

Thanks,
David

> 
> 
> Thanks
> - Ioi


More information about the serviceability-dev mailing list