RFR: 8364490: Fatal error on large SpecTrapLimitExtraEntries value [v3]
Anton Seoane Ampudia
aseoane at openjdk.org
Tue Nov 25 17:37:27 UTC 2025
> This PR addresses VM crashes on very large values for `SpecTrapLimitExtraEntries`.
>
> The experimental `SpecTrapLimitExtraEntries` allows for a user-specified number of extra method data trap entries for speculation. Currently, this number is implemented with an `int`, which means that users can specify very large values that will translate into huge `MethodData` objects that cannot be allocated in Metaspace.
>
> An `int` range of values should not be allowed, as negative `SpecTrapLimitExtraEntries` do not make any sense, and very high values (such as the ones that cause this crash) are equally nonsensical. This changeset adds a range to the flag values to address these issues.
>
> `SpecTrapLimitExtraEntries` is `MAX`ed with HotSpot's computed heuristic, which means that in any case it can only serve as a buffer above the heuristic. Based on benchmarks where I logged heuristic-derived values for extra `DataLayout` cells, even a value of 50 for `SpecTrapLimitExtraEntries` is more than sufficient. To provide some headroom and keep things simple, I have set the upper limit to 100.
>
> **Testing:** passes tiers 1-2
Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision:
Review comments
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28451/files
- new: https://git.openjdk.org/jdk/pull/28451/files/5ea304e3..49097207
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28451&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28451&range=01-02
Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/28451.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28451/head:pull/28451
PR: https://git.openjdk.org/jdk/pull/28451
More information about the hotspot-compiler-dev
mailing list