Integrated: 8217327: G1 Post-Cleanup region liveness printing should not print out-of-date efficiency
Joakim Nordström
github.com+779991+jaokim at openjdk.java.net
Mon Feb 1 18:22:42 UTC 2021
On Mon, 25 Jan 2021 11:52:26 GMT, Joakim Nordström <github.com+779991+jaokim at openjdk.org> wrote:
> **Description**
> This fix addresses the issue where gc-efficiency is printed incorrectly when logging post-marking and post-cleanup. The gc-efficiency is calculated in the end of the marking phase, to be logged in the post-cleanup section. It is however not reset, meaning that next phase's post-marking log will show the old value.
>
> - The gc-efficiency is initialized to -1 when it hasn't been calculated.
> - Negative gc-efficiency is displayed as a hyphen "-" in the summary.
> - The gc-efficiency is reset to -1 in `HeapRegion::note_start_of_marking()`
>
> **Note:** there is a sister issue that moves the post-cleanup printing to a later stage. Without this fix, the logging will still be incorrect, so both fixes are needed. See: [JDK-8260042: G1 Post-cleanup liveness printing occurs too early](https://github.com/openjdk/jdk/pull/2168)
>
> This fix has been tested together with the above mentioned fix.
>
> **Example**
> This is what logging like after fix has been applied.
> ### PHASE Post-Marking @ 410.303
> ### HEAP reserved: 0x0ffc00000-0x100000000 region-size: 1048576
> ###
> ### type address-range used prev-live next-live gc-eff remset state code-roots
> ### (bytes) (bytes) (bytes) (bytes/ms) (bytes) (bytes)
> ### OLD 0x0ffc00000-0x0ffd00000 1048368 1048368 1048368 - 8464 UPDAT 6096
> ### OLD 0x0ffd00000-0x0ffe00000 132856 132856 132856 - 2544 UPDAT 16
> ### SURV 0x0ffe00000-0x0fff00000 21368 21368 21368 - 2544 CMPLT 16
> ### FREE 0x0fff00000-0x100000000 0 0 0 - 2384 UNTRA 16
> ###
> ### SUMMARY capacity: 4.00 MB used: 1.15 MB / 28.67 % prev-live: 1.15 MB / 28.67 % next-live: 1.15 MB / 28.67 % remset: 0.02 MB code-roots: 0.01 MB
> ### PHASE Post-Cleanup @ 410.305
> ### HEAP reserved: 0x0ffc00000-0x100000000 region-size: 1048576
> ###
> ### type address-range used prev-live next-live gc-eff remset state code-roots
> ### (bytes) (bytes) (bytes) (bytes/ms) (bytes) (bytes)
> ### OLD 0x0ffc00000-0x0ffd00000 1048368 1048368 1048368 - 8624 UNTRA 6096
> ### OLD 0x0ffd00000-0x0ffe00000 132856 132856 132856 1352923.9 2544 CMPLT 16
> ### SURV 0x0ffe00000-0x0fff00000 21368 21368 21368 - 2544 CMPLT 16
> ### FREE 0x0fff00000-0x100000000 0 0 0 - 2384 UNTRA 16
> ###
> ### SUMMARY capacity: 4.00 MB used: 1.15 MB / 28.67 % prev-live: 1.15 MB / 28.67 % next-live: 1.15 MB / 28.67 % remset: 0.02 MB code-roots: 0.01 MB
> ### PHASE Post-Marking @ 450.310
> ### HEAP reserved: 0x0ffc00000-0x100000000 region-size: 1048576
> ###
> ### type address-range used prev-live next-live gc-eff remset state code-roots
> ### (bytes) (bytes) (bytes) (bytes/ms) (bytes) (bytes)
> ### OLD 0x0ffc00000-0x0ffd00000 1048368 1048368 1048368 - 8624 UPDAT 6096
> ### OLD 0x0ffd00000-0x0ffe00000 174456 174456 174456 - 2544 UPDAT 16
> ### SURV 0x0ffe00000-0x0fff00000 21368 21368 21368 - 2544 CMPLT 16
> ### FREE 0x0fff00000-0x100000000 0 0 0 - 2384 UNTRA 16
> ###
> ### SUMMARY capacity: 4.00 MB used: 1.19 MB / 29.66 % prev-live: 1.19 MB / 29.66 % next-live: 1.19 MB / 29.66 % remset: 0.02 MB code-roots: 0.01 MB
> ### PHASE Post-Cleanup @ 450.312
> ### HEAP reserved: 0x0ffc00000-0x100000000 region-size: 1048576
> ###
> ### type address-range used prev-live next-live gc-eff remset state code-roots
> ### (bytes) (bytes) (bytes) (bytes/ms) (bytes) (bytes)
> ### OLD 0x0ffc00000-0x0ffd00000 1048368 1048368 1048368 - 8624 UNTRA 6096
> ### OLD 0x0ffd00000-0x0ffe00000 174456 174456 174456 1266519.2 2544 CMPLT 16
> ### SURV 0x0ffe00000-0x0fff00000 21368 21368 21368 - 2544 CMPLT 16
> ### FREE 0x0fff00000-0x100000000 0 0 0 - 2384 UNTRA 16
> ###
>
> **Testing**
> - Manual testing
> - hs-tier1, hs-tier2
This pull request has now been integrated.
Changeset: 50f9a70f
Author: JSNORDST <JSNORDST at JSNORDST-P53.se.oracle.com>
Committer: Thomas Schatzl <tschatzl at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/50f9a70f
Stats: 30 lines in 3 files changed: 10 ins; 0 del; 20 mod
8217327: G1 Post-Cleanup region liveness printing should not print out-of-date efficiency
Reviewed-by: tschatzl, sjohanss
-------------
PR: https://git.openjdk.java.net/jdk/pull/2217
More information about the hotspot-gc-dev
mailing list