On Thu, 13 Nov 2025 16:30:28 GMT, Leonid Mesnik <[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
>
> test/hotspot/jtreg/serviceability/jvmti/FollowReferences/KindSystemClass/libKindSystemClass.cpp
> line 43:
>
>> 41: switch (reference_kind) {
>> 42: case JVMTI_HEAP_REFERENCE_SYSTEM_CLASS:
>> 43: *tag_ptr = ++class_counter;
>
> The callback is executed on VMThread, so counters should be atomic or
> protected by monitors.
Not sure I follow. There is no concurrent access to the variables.
FollowReferences is executed at safepoint (so the counters are updated by
single thread). The values are read after FollowReference returns (i.e. after
the safepoint)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524652595