RFR: 8350621: Code cache stops scheduling GC

Thomas Schatzl tschatzl at openjdk.org
Wed Jul 9 15:52:42 UTC 2025


On Wed, 9 Jul 2025 15:33:44 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Good finding! I think it looks good, but it should get reviewed by G1 experts. The test doesn't always pass. I've seen this once:
> 
> ```
> [12.943s][info ][codecache] Triggering aggressive GC due to having only 49.991% free memory
> [12.944s][trace][gc       ] C1 CompilerThread3: Try Collect Concurrently (CodeCache GC Aggressive): attempt 1
> [12.984s][debug][gc       ] GC(22) Allocated 2 survivor 0 old percent total 6.67% (10%)
> [12.984s][info ][gc       ] GC(22) Pause Young (Concurrent Start) (CodeCache GC Aggressive) 4M->2M(32M) 39.712ms
> [12.984s][info ][gc       ] GC(23) Concurrent Mark Cycle
> [12.984s][trace][gc       ] C1 CompilerThread3: Try Collect Concurrently (CodeCache GC Aggressive): wait
> [13.040s][info ][codecache] Code cache critically low; use aggressive aging
> [13.040s][info ][gc       ] GC(23) Pause Remark 3M->3M(32M) 6.383ms
> [13.052s][info ][gc       ] GC(23) Pause Cleanup 3M->3M(32M) 0.078ms
> [13.052s][info ][gc       ] GC(23) Concurrent Mark Cycle 67.851ms
> [13.052s][trace][gc       ] C1 CompilerThread3: Try Collect Concurrently (CodeCache GC Aggressive): complete after wait
> [13.056s][info ][codecache] Triggering aggressive GC due to having only 49.854% free memory
> [13.056s][trace][gc       ] C1 CompilerThread2: Try Collect Concurrently (CodeCache GC Aggressive): attempt 1
> [13.094s][debug][gc       ] GC(24) Allocated 2 survivor 1 old percent total 10.34% (10%)
> [13.095s][info ][gc       ] GC(24) Pause Young (Concurrent Start) (CodeCache GC Aggressive) 3M->2M(32M) 38.594ms
> [13.095s][trace][gc       ] C1 CompilerThread2: Try Collect Concurrently (CodeCache GC Aggressive): wait
> [13.095s][info ][gc       ] GC(25) Concurrent Mark Cycle
> [13.149s][info ][codecache] No code cache pressure; don't age code
> [13.149s][info ][gc       ] GC(25) Pause Remark 3M->3M(32M) 11.108ms
> [13.163s][info ][gc       ] GC(25) Pause Cleanup 3M->3M(32M) 0.072ms
> [13.163s][info ][gc       ] GC(25) Concurrent Mark Cycle 68.023ms
> [13.163s][trace][gc       ] C1 CompilerThread2: Try Collect Concurrently (CodeCache GC Aggressive): complete after wait
> Compiled 180 classes
> Compilation done, compiled 200 classes
> 
> STDERR:
> java.lang.RuntimeException: Could not find a CodeCache GC Threshold GC after finishing the concurrent cycle: expected true, was false
> ```
> 
> Seems like there are several ways the VM can take.

This is a test bug - for some reason the compiler triggered "Code Cache Aggressive" instead of "Code Cache Threshold" gcs. The former are a more urgent version of the latter, so for that test this is fine.

The test only checks for the latter.

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

PR Comment: https://git.openjdk.org/jdk/pull/26189#issuecomment-3053152382


More information about the hotspot-gc-dev mailing list