RFR: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM [v5]

Paul Hohensee phh at openjdk.org
Fri May 12 15:13:00 UTC 2023


On Tue, 9 May 2023 01:04:02 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Do you mean something like:
>> 
>>     JavaThreadIteratorWithHandle jtiwh;
>>     jlong result = ThreadService::exited_allocated_bytes();
>>     while (JavaThread *thread = jtiwh.next()) {
>>       ...
>> 
>> That would be fine for me. Otherwise I agree with the current compromise between accuracy and speed.
>
> Yes. Though I realize my comment needed to make clear that you need a thread to update the count after it has removed itself from the thread-list, for this to be an improvement.

Done as Volker suggests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13814#discussion_r1192495715


More information about the serviceability-dev mailing list