RFR: 8253262: Allocate in DumpRegion is not thread safe

Yumin Qi minqi at openjdk.java.net
Mon Sep 21 16:25:06 UTC 2020


On Mon, 21 Sep 2020 04:18:49 GMT, David Holmes <dholmes at openjdk.org> wrote:

> It seems to me that the need for locking should be an internal implementation detail of
> MetaspaceShared::symbol_space_alloc, rather than Symbol operator new.

I pushed before saw your above comment. The reason for current place is because the following code:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/symbol.cpp#L75
   DEBUG_ONLY(static void* last = 0);
   void* p = (void*)MetaspaceShared::symbol_space_alloc(size(len)*wordSize);
   assert(p > last, "must increase monotonically");
   DEBUG_ONLY(last = p);
   return p;
this 'last' is not thread safe either.

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

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


More information about the hotspot-dev mailing list