On Mon, 10 Nov 2025 20:54:56 GMT, Alex Menkov <[email protected]> wrote:

> FollowReferences with null initial_object starts heap walking from "heap 
> roots", which include system classes.
> All oops from ClassLoaderDataGraph are reported with 
> JVMTI_HEAP_REFERENCE_SYSTEM_CLASS kind, but some of the objects are not 
> classes.
> The fix updates FollowReferences to report non-class objects from 
> ClassLoaderDataGraph as JVMTI_HEAP_REFERENCE_OTHER
> 
> Testing: tier1..4,hs-tier5-svc

The fix looks good. I've posted a couple of nits.

src/hotspot/share/prims/jvmtiTagMap.cpp line 2193:

> 2191: };
> 2192: 
> 2193: // A supporting closure used to process ClassLoaderData roots

Nit: Need dot at the end of comment.

test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp
 line 79:

> 77: 
> 78:   for (int i = 0; i < class_counter; i++) {
> 79:     tags[i] = i+1;

Nit: Need spaces around `+` sign.

test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp
 line 101:

> 99: }
> 100: 
> 101: 

Nit: Unneeded extra empty line.

-------------

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28224#pullrequestreview-3455948919
PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520165317
PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520125928
PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2520132469

Reply via email to