RFR: 8321266: Add diagnostic RSS threshold [v3]
Thomas Stuefe
stuefe at openjdk.org
Fri May 23 08:21:05 UTC 2025
On Tue, 13 May 2025 09:20:44 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add specific percentage switch
>
> Hi Thomas -
>
> Looks good & useful.
>
> The Percent question looks resolved with the RssLimitPercent option. Glad to not have to state the "%" sign on the command line, even if it means there are two options there is no ambiguity.
>
> The example usage in the description here could use an update.
>
>
> Linux OOM Killer is mentioned. The risk is setting too high an RssLimit or too low an RssLimitCheckInterval, meaning the JVM gets killed by the OOM Killer before we trigger this feature. Any advice on how to choose these figures? 8-) That must depend on general memory pressure, so may not be easy to give a rule, and I see there is some discussion above, I'm just fishing for good advice.
>
>
>
> Is this really a Diagnostic flag, or something people would want to run in production?
>
> I see MallocLimit was diagnostic, but that seems like a diagnostic for non-production use, putting hard limit on what an app can allocate over time, so the app is being run for diagnostic purposes, not expected to be up for a long time.
>
> But this RSS resource limiting looks like a production feature?
@kevinjwalls Thank you for that feedback!
I have not forgotten this; have a new version, but will hold it off until 26.
> The Percent question looks resolved with the RssLimitPercent option. Glad to not have to state the "%" sign on the command line, even if it means there are two options there is no ambiguity.
Sure, that seems better.
> The example usage in the description here could use an update.
Yes, will do
> Linux OOM Killer is mentioned. The risk is setting too high an RssLimit or too low an RssLimitCheckInterval, meaning the JVM gets killed by the OOM Killer before we trigger this feature. Any advice on how to choose these figures? 8-) That must depend on general memory pressure, so may not be easy to give a rule, and I see there is some discussion above, I'm just fishing for good advice.
My new approach adds two thresholds: one limit threshold at the limit the user gives us (e.g. RssLimit=100m), and one warning threshold at 80% of that limit. Both threshold cause a bunch of reports to appear with the right log options; the second threshold can optionally also cause a fatal error.
An alternative would have been to give the customer the option to freely define multiple limits, e.g. "-XX:RssLimit=80m+warn;100m+fatal" but I don't know if we need that much degree of freedom...
> But this RSS resource limiting looks like a production feature?
Possibly; I wanted to avoid the CSR red tape; lets see what others think
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16938#issuecomment-2903653884
More information about the hotspot-dev
mailing list