RFR: 8364490: Fatal error on large SpecTrapLimitExtraEntries value [v3]
Anton Seoane Ampudia
aseoane at openjdk.org
Wed Dec 10 08:44:31 UTC 2025
On Tue, 25 Nov 2025 17:37:27 GMT, Anton Seoane Ampudia <aseoane at openjdk.org> wrote:
>> 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
Thanks all for the reviews!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28451#issuecomment-3635977705
More information about the hotspot-compiler-dev
mailing list