RFR: 8353564: Fail fatally if os::release_memory or os::uncommit_memory fails [v2]
Robert Toyonaga
duke at openjdk.org
Fri Jan 23 15:07:08 UTC 2026
On Fri, 23 Jan 2026 06:52:16 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > Thank you everyone for the feedback!
> > I've removed the error strings now.
> > > os::unmap_memory only returns true now. Is there a reason why the return value type of this function is not changed?
> >
> >
> > Yes, they can all return void now. I've made the change and updated the callers where necessary too.
> > > Much more sense would be to (in a separate PR) highlight the fact in the hs-err file that this particular native OOM may have been caused by running against the mapping limit, and that increasing said limit may help. Maybe we do this already, not sure.
> >
> >
> > How about if I added that note in the fatal error message in `os::uncommit_memory`? I think then that note should also show up in the hs_err file.
>
> Sure, that would work, but this would be highly Linux-specific. So, would need ifdefs.
>
> Wait, the failing code is OS specific, too. So, okay :-)
>
> You need to do this for ENOMEM only then.
Because `os::uncommit_memory` could also fail due to bad arguments on other platforms, I added an earlier fatal error in os_linux.cpp `pd_uncommit_memory`. This should be reached before the general fatal error in `os::uncommit_memory` and avoids needing ifdefs. I also check the error number there too.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29240#issuecomment-3790655758
More information about the hotspot-dev
mailing list