RFR: 8366925: Improper std::nothrow new expression in NativeHeapTrimmerThread ctor [v2]

Guanqiang Han ghan at openjdk.org
Tue Sep 16 01:00:01 UTC 2025


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27275/files
  - new: https://git.openjdk.org/jdk/pull/27275/files/45a18bc6..8e2df85f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27275&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27275&range=00-01

  Stats: 5 lines in 1 file changed: 0 ins; 4 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/27275.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27275/head:pull/27275

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


More information about the hotspot-runtime-dev mailing list