[jdk11u-dev] RFR: 8310451: CMS MxBean reports zero memory usage

Zhengyu Gu zgu at openjdk.org
Thu Jun 22 13:36:07 UTC 2023


CMS GC notification sometimes reports zero memory usages, because background sweep GC overlaps regular GC, that results consecutive gc end calls. The first gc end call pushes correct GC stats info, then reset current GC stats info. When the second gc end call arrives, there is no data to report `(gc index == 0)`, but it pushes notification anyway.

The patch avoids to push the second notification if there is no data available.

Current jdk head has the same code, but none of other GCs returns `gc index == 0`, except CMS.

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

Commit messages:
 - 8310451: CMS MxBean reports zero memory usage

Changes: https://git.openjdk.org/jdk11u-dev/pull/1986/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=1986&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310451
  Stats: 9 lines in 1 file changed: 4 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk11u-dev/pull/1986.diff
  Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/1986/head:pull/1986

PR: https://git.openjdk.org/jdk11u-dev/pull/1986


More information about the jdk-updates-dev mailing list