RFR: 8264149 BreakpointInfo::set allocates metaspace object in VM thread

David Holmes dholmes at openjdk.java.net
Fri Mar 26 23:08:38 UTC 2021


On Thu, 25 Mar 2021 21:47:46 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change creates a Metaspace::allocate function that doesn't pass TRAPS to be used by MethodCounters.  TRAPS and exceptions shouldn't be thrown from non-JavaThreads.
> 
> Tested with tier1-7.

src/hotspot/share/memory/metaspace.cpp line 816:

> 814:   }
> 815: 
> 816:   return result;

Shouldn't we still try to find more memory by calling Universe::heap()->satisfy_failed_metadata_allocation before giving up? Or can that not work if called from the VMThread?

src/hotspot/share/memory/metaspace.hpp line 127:

> 125:                             MetaspaceObj::Type type, TRAPS);
> 126: 
> 127:   // Nothrow version of allocate which can be called by a non-Java thread.

"Nothrow" is a C++ concept. I would just say "Non-TRAPS version ... Returns NULL on failure."

src/hotspot/share/oops/method.cpp line 571:

> 569:     CompileBroker::log_metaspace_failure();
> 570:     ClassLoaderDataGraph::set_metaspace_oom(true);
> 571:     return NULL;   // return the exception (which is cleared)

Comment needs updating

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

PR: https://git.openjdk.java.net/jdk/pull/3207


More information about the hotspot-dev mailing list