RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v12]
Volker Simonis
simonis at openjdk.org
Tue May 9 14:32:37 UTC 2023
On Tue, 9 May 2023 01:21:14 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Paul Hohensee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Implement 32-bit linux Atomic::add()
>
> src/hotspot/share/services/threadService.cpp line 224:
>
>> 222:
>> 223: decrement_thread_counts(jt, daemon);
>> 224: ThreadService::incr_exited_allocated_bytes(jt->cooked_allocated_bytes());
>
> Again this is too soon. This should be deferred until after the thread has removed itself from the threads-list.
Here I agree. This method (i.e. `ThreadService::current_thread_exiting()`) is called from `JavaThread::exit()` *before* the call to `Threads::remove()`. I think this call here to `ThreadService::incr_exited_allocated_bytes()` could be removed completely in favor of an unconditional call to `ThreadService::incr_exited_allocated_bytes()` in `ThreadService::remove_thread()` (which will be called by `Threads::remove()` *after* it removed the thread from the thread list). See my comment there.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1188698968
More information about the serviceability-dev
mailing list