RFR: 8267924: Misleading G1 eager reclaim detail logging
tschatzl at openjdk.java.net
Wed Jun 2 14:46:39 UTC 2021
can I have reviews for this change that brushes up `gc+humongous` logging?
In particular, during review of some logs several issues were found with the logging.
Both the "Live humongous region" and "Dead humongous region" logs
* the remset count is always zero at the point of printing (end of gc) because G1 never pushes new cross-region references into remembered set entries during gc, and for candidates we actually just flushed them
* the reclaim candidate flag is always zero at that point: if it got a "Live humongous" message, the source of that information must be false at that point. If "Dead humongous", it must have been true (one).
This change modifies the log output to try to give useful information: first, g1 prints information for all humongous regions when deciding whether something is a candidate. This means that the printed information is current. At the end of gc only reclaimed regions are printed, repeating the information from the printout at the beginning does not give more information.
E.g. a sample output from the test case
First, all humongous regions
Humongous region 0 (object size 41943056 @ 0x00000000f8000000) remset 0 code roots 0 marked 0 reclaim candidate 1 type array 1
Humongous region 71 (object size 25165840 @ 0x00000000fc700000) remset 0 code roots 0 marked 0 reclaim candidate 1 type array 1
Humongous region 41 (object size 4194320 @ 0x00000000fa900000) remset 0 code roots 0 marked 0 reclaim candidate 1 type array 1
Humongous region 46 (object size 25165840 @ 0x00000000fae00000) remset 0 code roots 0 marked 0 reclaim candidate 1 type array 1
Later only reclaimed ones:
Reclaimed humongous region 46 (object size 25165840 @ 0x00000000fae00000)
Instead of currently:
Live humongous region 789 object size 2160888 start 0x00000006e2a00000 with remset 1 code roots 0 is marked 0 reclaim candidate 0 type array 0
Dead humongous region 182 object size 16777232 start 0x000000074b600000 with remset 0 code roots 0 is marked 0 reclaim candidate 1 type array 1
This unfortunately kind of invalidates some websites trying to explain these log messages, but I still prefer to have useful output.
- Initial import
Stats: 32 lines in 3 files changed: 11 ins; 16 del; 5 mod
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4305/head:pull/4305
More information about the hotspot-gc-dev