Withdrawn: 8354727: CompilationPolicy creates too many compiler threads when code cache space is scarce

Manuel Hässig mhaessig at openjdk.org
Wed Jun 18 09:25:43 UTC 2025


On Mon, 16 Jun 2025 13:10:34 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

> # Issue Summary
> 
> Running
> 
> java -XX:+SegmentedCodeCache -XX:ReservedCodeCacheSize=10M -XX:NonNMethodCodeHeapSize=6M \
>      -XX:ProfiledCodeHeapSize=5M -XX:NonProfiledCodeHeapSize=5M -version
> 
> on a machine with more than 255 cores, this would fail with the message that the specified `NonNMethodCodeHeapSize` is too small to fit all compiler buffers (instead of failing because the sum of the heaps is larger than the `ReservedCodeCacheSize`). Hence, the calculated compiler count is too high. This is due to CompilationPolicy::initialize() checking how many compiler buffers fit into the `ReservedCodeCacheSize`. However, in the case above, this is significantly larger than `NonNMethodCodeHeapSize` and causes a check updated in #17244 to fail that should ensure that `NonNMethodCodeHeapSize` is at least `CodeCacheMinimumUseSpace` plus the size of all `CICompilerCount` compiler buffers. This is stronger than before #17244 where this check merely required `NonNMethodCodeHeapSize >= CodeCacheMinimumUseSpace` due to the fact that compiler buffers can also use the rest of the code cache if the non-nmethod heap is not sufficient.
> 
> # Change Rationale
> 
> This PR reverts the failing check to ensuring `NonNMethodCodeHeapSize >= CodeCacheMinimumUseSpace` since the computation of the ergonomic `CICompilerCount` in `CompilationPolicy::initialize()` does not support the assumption that all compiler buffers must always fit inside the non-nmethod code heap. 
> 
> This change required to adjust a test, because with the weaker check, it is currently not possible to trigger it from the commandline.
> 
> # Testing
> 
> - [x] [Github Actions](https://github.com/mhaessig/jdk/actions/runs/15681197877)
> - [x] tier1 and tier2 plus some Oracle internal testing

This pull request has been closed without being integrated.

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

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


More information about the hotspot-compiler-dev mailing list