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

Per Liden pliden at openjdk.java.net
Tue Apr 13 11:25:05 UTC 2021


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.

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

Commit messages:
 - 8265127: ZGC: Fix incorrect reporting of reclaimed memory

Changes: https://git.openjdk.java.net/jdk/pull/3462/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3462&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8265127
  Stats: 80 lines in 9 files changed: 54 ins; 1 del; 25 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3462.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3462/head:pull/3462

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



More information about the hotspot-gc-dev mailing list