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

Manuel Hässig mhaessig at openjdk.org
Wed Jun 18 15:00:04 UTC 2025


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

- [ ] [Github Actions](https://github.com/mhaessig/jdk/actions/runs/15735062162)
- [ ] tier1 through tier3 plus Oracle internal testing on all Oracle supported platforms

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

Commit messages:
 - Remove NMethodSizeLimit and make C1 code buffer size a constant

Changes: https://git.openjdk.org/jdk/pull/25876/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25876&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8358578
  Stats: 56 lines in 6 files changed: 0 ins; 48 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/25876.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25876/head:pull/25876

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


More information about the hotspot-compiler-dev mailing list