RFR: JDK-8295889: NMT preinit code does not handle allocation errors

David Holmes dholmes at openjdk.org
Wed Oct 26 05:19:41 UTC 2022


On Tue, 25 Oct 2022 15:18:05 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> The NMT preinit allocator (used for os::malloc and friends before the VM is initialized) does not handle malloc errors, nor does it handle overflows due to large sizes (it uses malloc headers too). Both cases need to be handled.
> 
> However, we can keep matters very simple. No need to propagate errors up to the caller; we can just fatal out on errors here since, in this phase, there is no alternative for failed allocations.

Doesn't seem unreasonable to check for OOM even though highly unlikely during VM init. But how would an overflow arise in practice? Seems like something more suited for an assertion.

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

PR: https://git.openjdk.org/jdk/pull/10855


More information about the hotspot-runtime-dev mailing list