diff --git a/runtime/compiler/runtime/J9CodeCacheManager.cpp b/runtime/compiler/runtime/J9CodeCacheManager.cpp index 066720082e8..d1589c53f4f 100644 --- a/runtime/compiler/runtime/J9CodeCacheManager.cpp +++ b/runtime/compiler/runtime/J9CodeCacheManager.cpp @@ -743,13 +743,15 @@ J9::CodeCacheManager::almostOutOfCodeCache() TR::CodeCacheConfig &config = self()->codeCacheConfig(); - // If we can allocate another code cache we are fine - // Put common case first + // If we can allocate another code cache we are fine. + // Put common case first. if (self()->canAddNewCodeCache()) + { return false; + } else { - // Check the space in the most current code cache + // Check the space in the most current code cache. bool foundSpace = false; { @@ -767,6 +769,7 @@ J9::CodeCacheManager::almostOutOfCodeCache() if (!foundSpace) { _lowCodeCacheSpaceThresholdReached = true; // Flag can be checked under debugger + _jitConfig->lowCodeCacheFreeSpace = 1; if (config.verbosePerformance()) { TR_VerboseLog::writeLineLocked(TR_Vlog_CODECACHE,"Reached code cache space threshold. Disabling JIT profiling."); diff --git a/runtime/oti/j9nonbuilder.h b/runtime/oti/j9nonbuilder.h index 6606c97601c..cf4f8c7c02a 100644 --- a/runtime/oti/j9nonbuilder.h +++ b/runtime/oti/j9nonbuilder.h @@ -4364,6 +4364,7 @@ typedef struct J9JITConfig { void *serverAOTMethodSet; UDATA serverAOTQueryThread; #endif /* defined(J9VM_OPT_JITSERVER) */ + I_32 lowCodeCacheFreeSpace; /* bool set to 1 when the JIT detects a very low amount of free code cache space; never reset */ } J9JITConfig; #if defined(J9VM_OPT_CRIU_SUPPORT)