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

Stefan Johansson sjohanss at openjdk.java.net
Mon Apr 26 11:38:28 UTC 2021


On Tue, 13 Apr 2021 11:18:10 GMT, Per Liden <pliden 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.

Looks good.

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

Marked as reviewed by sjohanss (Reviewer).

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



More information about the hotspot-gc-dev mailing list