RFR: JDK-8256844: Make NMT late-initializable

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


On Fri, 30 Jul 2021 16:36:41 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/services/nmtPreInit.hpp line 309:
>> 
>>> 307:         ::memcpy(p_new, a->payload(), MIN2(a->size, new_size));
>>> 308:         (*rc) = p_new;
>>> 309:         _num_reallocs_pre_to_post++;
>> 
>> post-NMT-init counter updates are racy.
>
> True, this is racy. It's just for diagnostics though - I rather remove them than make them atomic since we would pay for this with every malloc. Or, maybe atomic + debug only?

Either one is fine.

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

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


More information about the core-libs-dev mailing list