Lightweight G1 remembered set logging

Tianqi Xia txiadev at gmail.com
Thu Apr 21 02:05:06 UTC 2022


Hi,

It seems like currently the only way to log rememebered set usage during GC
is setting the G1SummarizeRSetStatsPeriod flag, which can be quite
expensive. Testing on my local box, running BigRamTester (by Thomas Schatzl)
with JDK11 + 10GB heap + 1GB RSet setup, it took hundreds of milliseconds
to process and print those remembered set usage information, and this
happened when the world is stopped.

After a little bit hacking and digging I found most of the time is spent on
the following 2 operations:
1. Calculating the size of PerRegionTable freelist, with 1GB RSet usage,
this freelist can contain more than half a million entries.
2. Calculating the occupancy of OtherRegionTable, which iterates over all
PerRegionTables being used.
After omitting these 2 operations, we can cut down the overall logging time
of remembered set usage to ~1ms, under the same setup.

Can we introduce a "lightweight" mode of remembered set logging that trims
the above mentioned 2 operations? It makes it possible for turning on
remebered set logging in prodcution envrionment, which really helps
diagnose certain performance issues.

Regards,
Tianqi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20220421/867448a3/attachment.htm>


More information about the hotspot-gc-use mailing list