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

duke duke at openjdk.org
Thu Jun 19 15:20:31 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

@mhaessig 
Your change (at version 66b7ba3c003d8e3fcd1796c2e2766becf655bb82) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/25876#issuecomment-2988467131


More information about the hotspot-compiler-dev mailing list