RFR: JDK-8256844: Make NMT late-initializable

Zhengyu Gu zgu at openjdk.java.net
Fri Jul 30 18:57:31 UTC 2021


On Fri, 30 Jul 2021 16:33:17 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> The code is implicitly thread-safe because the hashmap is only modified in the pre-NMT-init phase. After NMT initialization, the table is read-only. During pre-NMT-init we are effectively single-threaded - at most two threads access the map, the thread loading the libjvm, and the thread calling CreateJavaVM, but not at the same time.
>> 
>> See also the asserts in the AllStatic class `NMTPreInit`.
>> 
>> (I should have described it more clearly, will add a comment.)
>
> So, you are saying that there is no memory that is malloc'd pre-NMT-init phase and freed post-NMT-init phase?

Okay, I see. It just leaks those memory, so the table can be read-only.

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

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


More information about the core-libs-dev mailing list