RFR: 8371083: FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS [v2]
Leonid Mesnik
lmesnik at openjdk.org
Thu Nov 13 19:53:14 UTC 2025
On Thu, 13 Nov 2025 19:18:38 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
>> 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)
Thanks for explanation. Then it is no need to synchronize.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28224#discussion_r2524733585
More information about the hotspot-dev
mailing list