RFR: 8334564: VM startup: fatal error: FLAG_SET_ERGO cannot be used to set an invalid value for NonNMethodCodeHeapSize

Martin Doerr mdoerr at openjdk.org
Thu Jun 20 16:21:10 UTC 2024


On Thu, 20 Jun 2024 15:54:29 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

> CodeHeap segment sizes are aligned to page size multiples. This can result in the non-nmethod segment receiving size 0 (zero). Range checking during FLAG_SET_ERGO processing detects that and raises an error, preventing the vm from starting.
> 
> This fix increases the minimum size of the non-nmethod segment to page size, preventing it from being rounded down to zero.
> 
> Verified by manual testing. Nightly tests (mainly to discover unexpected side effects) pending.

Looks good. Thanks for fixing!

src/hotspot/share/code/codeCache.cpp line 234:

> 232:     // sizes, this may result in (non_nmethod.size == 0) which is not acceptable.
> 233:     // Therefore, force non_nmethod.size to at least min_size.
> 234:     non_nmethod.size  = MAX2(non_nmethod.size, min_size);

Minor nit: Extra whitespace.

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

Marked as reviewed by mdoerr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19812#pullrequestreview-2130865571
PR Review Comment: https://git.openjdk.org/jdk/pull/19812#discussion_r1647833083


More information about the hotspot-compiler-dev mailing list