RFR: 8372412: Increase buffer size for ring-buffer events in CollectedHeap
Joel Sikström
jsikstro at openjdk.org
Mon Nov 24 14:17:34 UTC 2025
Hello,
The buffer size we changed to when separating GC and Metaspace printing code is too small for Parallel and Serial (and maybe also for long-running programs in general). I suggest we bump the buffer-size to 1024 bytes. This also leaves room for more lengthy prints, which ZGC might have if running on a machine with many NUMA nodes.
The default number of events stored in each ring-buffer is 20, controlled via the diagnostic flag `LogEventsBufferEntries`. In it's default setting, the total memory usage of each ring-buffer (Metaspace and Heap) will increase from (512 bytes * 20) 10KB to (1024 * 20) 20KB.
For completeness, the content of the ring-buffers are only printed in hs_err files, using the `-XX:+PrintVMInfoAtExit` (diagnostic flag) or using `jcmd VM.info`
Testing:
* Local testing with `java -XX:+UseParalellGC/UseSerialGC -XX:+PrintVMInfoAtExit ...` to see that the message is not cut-off any longer.
-------------
Commit messages:
- 8372412: Increase buffer size for ring-buffer events in CollectedHeap
Changes: https://git.openjdk.org/jdk/pull/28476/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28476&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8372412
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/28476.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28476/head:pull/28476
PR: https://git.openjdk.org/jdk/pull/28476
More information about the hotspot-gc-dev
mailing list