RFR: 8358578: Small -XX:NMethodSizeLimit triggers "not in CodeBuffer memory" assert in C1

Tobias Hartmann thartmann at openjdk.org
Thu Jun 19 11:20:27 UTC 2025


On Wed, 18 Jun 2025 14:07:29 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

> Running `java -XX:NMethodSizeLimit=100 -version` triggers an assert because the lower limit of the debug flag `NMethodSizeLimit` is too low.
> 
> `NMethodSizeLimit` corresponds more or less directly to the C1 code buffer size. It was added as a debug flag in 2005 to make it easier to stress the code paths related to the buffer size. Nowadays, it is not used for any stressing, but it has caused a bunch of bugs ([JDK-8316653](https://bugs.openjdk.org/browse/JDK-8316653), [JDK-8318817](https://bugs.openjdk.org/browse/JDK-8318817), [JDK-8320682](https://bugs.openjdk.org/browse/JDK-8320682)). Therefore, this PR removes the debug flag `NMethodSizeLimit` and converts it to a constant.
> 
> Because this removes the code causing the error, this bug does not have a regression test (in fact, it removes regression tests).
> 
> # Testing
> 
> - [x] [Github Actions](https://github.com/mhaessig/jdk/actions/runs/15735062162)
> - [ ] tier1 through tier3 plus Oracle internal testing on all Oracle supported platforms

Looks good to me too.

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

Marked as reviewed by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25876#pullrequestreview-2942573116


More information about the hotspot-compiler-dev mailing list