RFR: 8364558: Failure to generate compiler stubs from compiler thread should not crash VM when compilation disabled due to full CodeCache

Andrew Dinn adinn at openjdk.org
Thu Aug 7 14:01:24 UTC 2025


On Tue, 5 Aug 2025 23:39:59 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> @vnkozlov This is still intermittent as it depends on a race. However, I ran this repeatedly with the initial and reserved cache sizes that caused the problem and with stubs logging enabled and observed execution to continue in cases where the race would previously have caused a crash. Here is the outpout from such a run. Look for the new stubs log warning message in the following output:
>> 
>> [adinn at clarapandy JDK-8364558]$ build/linux-aarch64-server-release/images/jdk/bin/java -XX:InitialCodeCacheSize=873K -XX:ReservedCodeCacheSize=995k -Xlog:stubs -version
>> [0.001s][info][stubs] StubRoutines (preuniverse stubs)	 not generated
>> [0.003s][info][stubs] StubRoutines (initial stubs)	 [0x0000ffff5bfb4080, 0x0000ffff5bfb6a10] used: 5388, free: 5252
>> [0.003s][info][stubs] StubRoutines (continuation stubs)	 [0x0000ffff5bfb7000, 0x0000ffff5bfb7a50] used: 600, free: 2040
>> [0.004s][info][stubs] StubRoutines (final stubs)	 [0x0000ffff5bff58c0, 0x0000ffff5c00f568] used: 11568, free: 94072
>> [0.007s][warning][codecache] CodeCache is full. Compiler has been disabled.
>> [0.007s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize=
>> OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
>> OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
>> OpenJDK 64-Bit Server VM warning: C1 initialization failed. Shutting down all compilers
>> CodeCache: size=1008Kb used=444Kb max_used=1008Kb free=563Kb
>>  bounds [0x0000ffff5bfb4000, 0x0000ffff5c0b0000, 0x0000ffff5c0b0000]
>>  total_blobs=215, nmethods=0, adapters=177, full_count=2
>> Compilation: disabled (not enough contiguous free space left), stopped_count=1, restarted_count=0
>> [0.007s][warning][stubs    ] Ignoring failed allocation of blob Stub Generator compiler_blob under compiler thread
>> OpenJDK 64-Bit Server VM warning: C2 initialization failed. Shutting down all compilers
>> openjdk version "26-internal" 2026-03-17
>> OpenJDK Runtime Environment (build 26-internal-adhoc.adinn.JDK-8364558)
>> OpenJDK 64-Bit Server VM (build 26-internal-adhoc.adinn.JDK-8364558, mixed mode, sharing)
>> 
>> 
>> That ought to have fixed the problem with test StartOutput. However, after running more times I spotted this (very much less frequent) error exit:
>> 
>> 
>> [adinn at clarapandy JDK-8364558]$ build/linux-aarch64-server-release/images/jdk/bin/java -XX:InitialCodeCacheSize=873K -XX:ReservedCodeCacheSize=995k -Xlog:stubs -version
>> [0.00...
>
>> Any ideas how to proceed? Shall I still continue wiht the current patch?
> 
> Don't worry about adapters. It is different issue which can happen at any time with very small CodeCache.
> 
>> Also, do we need a better title for the JIRA and PR?
> 
> Yes, please update it. May be: "Failure to generated compiler stubs from compiler thread should not crash VM when compilation disabled due to full CodeCache"

@vnkozlov Thanks for the review. Can I get a second one? @shipilev @ashu-mehra

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

PR Comment: https://git.openjdk.org/jdk/pull/26642#issuecomment-3164325141


More information about the hotspot-dev mailing list