RFR: 8265436: G1: Improve gc+phases log output during full gc
Thomas Schatzl
tschatzl at openjdk.java.net
Tue Apr 20 09:39:07 UTC 2021
On Tue, 20 Apr 2021 02:14:39 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> Hi all,
>>
>> can I have reviews for this fix to remove recently introduced log messages from `debug` to `trace` level?
>>
>> If you select `gc+phases=debug` logging with [JDK-8262068](https://bugs.openjdk.java.net/browse/JDK-8262068), you get:
>>
>> [0.695s][debug][gc,phases] GC(51) Phase 1: Weak Processing 0.309ms
>> [0.695s][debug][gc,phases] GC(51) ClassLoaderData 0.003ms
>> [0.695s][debug][gc,phases] GC(51) Trigger cleanups 0.002ms
>> [0.699s][debug][gc,phases] GC(51) Phase 1: Class Unloading and Cleanup 4.056ms
>> [0.699s][info ][gc,phases] GC(51) Phase 1: Mark live objects 7.722ms
>> [0.699s][debug][gc,phases] GC(51) Phase 2: skip compaction region index: 0, live words: 125610
>> [repeated for every region skipped]
>>
>> the last per-region message is quite annyoing and just fills up logs as the code prints one line per affected region (which may be a lot), so I suggest to move it to `trace` level. I did suggest to add some nice phase 2 region summary in [JDK-8265437](https://bugs.openjdk.java.net/browse/JDK-8265437), but that is out of scope for this change.
>>
>> Testing: local testing
>>
>> Thanks,
>> Thomas
>
> just realized, the test code needs to be adjusted accordingly.
> '''
> public class TestG1SkipCompaction {
> public static void runTest() throws Exception {
> final String[] arguments = {
> "-XX:+UseG1GC",
> "-XX:MarkSweepDeadRatio=3",
> "-Xmx8m",
> "-Xms8M",
> "-Xlog:gc+phases=debug", // here, from debug to trace
> "-XX:G1HeapRegionSize=1m",
> GCTest.class.getName()
> };
> '''
I will integrate after tier1-2 testing that runs that test passed. Thanks @Hamlin-Li @albertnetymk for your reviews.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3569
More information about the hotspot-gc-dev
mailing list