RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v5]
David Holmes
dholmes at openjdk.org
Tue May 9 01:07:27 UTC 2023
On Mon, 8 May 2023 16:41:13 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> src/hotspot/share/services/threadService.cpp line 173:
>>
>>> 171: // was not called, e.g., JavaThread::cleanup_failed_attach_current_thread().
>>> 172: decrement_thread_counts(thread, daemon);
>>> 173: ThreadService::incr_exited_allocated_bytes(thread->cooked_allocated_bytes());
>>
>> By doing this here you increase the likelihood of double-accounting for this thread. If you do this after the thread is no longer on any threads-list you may miss its contribution entirely, but you won't double-count it.
>
> If the `thread` is no longer on any ThreadsList, then it is not safe to access `thread`.
@dcubed-ojdk This is the current thread acting on itself
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1188019689
More information about the serviceability-dev
mailing list