RFR: 8265127: ZGC: Fix incorrect reporting of reclaimed memory

Per Liden pliden at openjdk.java.net
Mon Apr 26 11:56:28 UTC 2021


On Mon, 19 Apr 2021 13:37:51 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> When Java threads relocate objects, ZGC will over-report number of reclaimed bytes and under-report amount of garbage left after GC. This happens because the logic calculating the total number of reclaimed bytes assumes all objects where relocated by GC workers. The result is that the information printed in the GC log can be skewed.
>> 
>> This patch solves this by keeping track of the number of bytes relocated by Java threads, and using that number in the logic calculating the total number of reclaimed bytes.
>
> Marked as reviewed by ayang (Committer).

Thanks @albertnetymk and @kstefanj for reviewing!

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

PR: https://git.openjdk.java.net/jdk/pull/3462



More information about the hotspot-gc-dev mailing list