G1: Lightweight remembered set logging

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


Hi,

It seems like currently the only way to log remembered 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 the 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
remembered set logging in the production environment, which really helps
diagnose certain performance issues.

Regards,
Tianqi



More information about the hotspot-gc-dev mailing list