RFR: 8366925: Improper std::nothrow new expression in NativeHeapTrimmerThread ctor [v2]
Kim Barrett
kbarrett at openjdk.org
Tue Sep 16 06:52:40 UTC 2025
On Tue, 16 Sep 2025 01:00:01 GMT, Guanqiang Han <ghan at openjdk.org> wrote:
>> Please review this Patch.
>>
>> **Description:**
>> Add null check for _lock in NativeHeapTrimmerThread constructor. If allocation of the lock fails (_lock == nullptr), it indicates an out-of-memory condition. Since even this small allocation failed, it's unlikely that subsequent operations would succeed, so we terminate the JVM immediately.
>
> Guanqiang Han has updated the pull request incrementally with one additional commit since the last revision:
>
> Update trimNativeHeap.cpp
>
> remove std::nothrow and rely on the default new handling
Looks good.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27275#pullrequestreview-3227833340
More information about the hotspot-runtime-dev
mailing list