RFR: 8357818: Shenandoah doesn't use shared API for printing heap before/after GC

Rui Li duke at openjdk.org
Fri Jul 11 18:41:21 UTC 2025


Add logging for Shenandoah as well as Generational Shenandoah. 

Log samples:


######################################
Before gc
######################################
[0.231s][debug][gc,heap      ] GC(0) Heap Before GC invocations=0 (full 0):
[0.231s][debug][gc,heap      ] GC(0)  Shenandoah Heap
[0.231s][debug][gc,heap      ] GC(0)   100M max, 100M soft max, 100M committed, 39686K used
[0.231s][debug][gc,heap      ] GC(0)   400 x 256 K regions
[0.231s][debug][gc,heap      ] GC(0)  Status: not cancelled
[0.231s][debug][gc,heap      ] GC(0)  Reserved region:
[0.231s][debug][gc,heap      ] GC(0)   - [0x00000000f9c00000, 0x0000000100000000) 
[0.231s][debug][gc,heap      ] GC(0)  Collection set:
[0.231s][debug][gc,heap      ] GC(0)   - map (vanilla): 0x0000000000004e70
[0.231s][debug][gc,heap      ] GC(0)   - map (biased):  0x0000000000001000
[0.231s][debug][gc,heap      ] GC(0) 
[0.231s][debug][gc,metaspace ] GC(0) Metaspace Before GC invocations=0 (full 0):
[0.231s][debug][gc,metaspace ] GC(0)  Metaspace       used 153K, committed 384K, reserved 1114112K
[0.231s][debug][gc,metaspace ] GC(0)   class space    used 3K, committed 128K, reserved 1048576K




######################################
After gc
######################################
[2.067s][debug][gc,heap        ] GC(11) Heap After GC invocations=0 (full 0):
[2.067s][debug][gc,heap        ] GC(11)  Shenandoah Heap
[2.067s][debug][gc,heap        ] GC(11)   100M max, 100M soft max, 100M committed, 101356K used
[2.067s][debug][gc,heap        ] GC(11)   400 x 256 K regions
[2.067s][debug][gc,heap        ] GC(11)  Status: not cancelled
[2.067s][debug][gc,heap        ] GC(11)  Reserved region:
[2.067s][debug][gc,heap        ] GC(11)   - [0x00000000f9c00000, 0x0000000100000000) 
[2.067s][debug][gc,heap        ] GC(11)  Collection set:
[2.067s][debug][gc,heap        ] GC(11)   - map (vanilla): 0x0000000000004e70
[2.067s][debug][gc,heap        ] GC(11)   - map (biased):  0x0000000000001000
[2.067s][debug][gc,heap        ] GC(11) 
[2.067s][debug][gc,metaspace   ] GC(11) Metaspace After GC invocations=0 (full 0):
[2.067s][debug][gc,metaspace   ] GC(11)  Metaspace       used 190K, committed 384K, reserved 1114112K
[2.067s][debug][gc,metaspace   ] GC(11)   class space    used 4K, committed 128K, reserved 1048576K

-------------

Commit messages:
 - 8357818: Shenandoah doesn't use shared API for printing heap before/after GC

Changes: https://git.openjdk.org/jdk/pull/26272/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26272&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357818
  Stats: 4 lines in 2 files changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26272.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26272/head:pull/26272

PR: https://git.openjdk.org/jdk/pull/26272


More information about the shenandoah-dev mailing list