JDK-8358283 : Inconsistent failure mode for MetaspaceObj::operator new(size_t, MemTag)
  • Type: New Feature
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2025-06-02
  • Updated: 2025-06-02
Related Reports
Relates :  
Description
The overload `MetaspaceObj::operator new(size_t, MemTag)` was added by JDK-8355003. It is declared nothrow. But it is implemented by calling `AllocateHeap` with the default failure type, e.g. `EXIT_OOM`. If it needs to return null on allocation failure then the failure mode for `AllocateHeap` needs to be changed to `RETURN_NULL`. If it doesn't need to return null, then the nothrow exception specification should be removed, to avoid unnecessary overhead from that specification.