SA needs to add support for scanning StackChunks in order for the "reverse pointer" support to work properly and find references to objects that come via a StackChunk (directly or indirectly).
The heap scanning starts with the roots, and then does recursive scans of each root object. I've been tracking down how it does this recursive scan. It looks like when visiting a non-array type, you end up in the following Oop method:
public void iterateFields(OopVisitor visitor, boolean doVMFields) {
super.iterateFields(visitor, doVMFields);
((InstanceKlass) getKlass()).iterateNonStaticFields(visitor, this);
}
I think if we add InstanceStackChunkKlass::iterateNonStaticFields(), we can have it make the visitor.doOop() call for each oop in the StackChunk, so this might be pretty easy to do. Writing a test will probably be the hardest part.
The heap scanning starts with the roots, and then does recursive scans of each root object. I've been tracking down how it does this recursive scan. It looks like when visiting a non-array type, you end up in the following Oop method:
public void iterateFields(OopVisitor visitor, boolean doVMFields) {
super.iterateFields(visitor, doVMFields);
((InstanceKlass) getKlass()).iterateNonStaticFields(visitor, this);
}
I think if we add InstanceStackChunkKlass::iterateNonStaticFields(), we can have it make the visitor.doOop() call for each oop in the StackChunk, so this might be pretty easy to do. Writing a test will probably be the hardest part.
- relates to
-
JDK-8195120 Finish SA OopStorage support
- Open
-
JDK-8307451 jhsdb jstack assertion failure on virtual threads
- Open
-
JDK-8299426 Heap dump does not contain virtual Thread stack references
- Closed