Two small improvements are possible related to how we handle the NMT level.
We read the NMT level at every malloc; that is unavoidable. But we also read a second variable that shadows the NMT level `_nmt_was_initialized`. That state is synonymous with NMT level "unknown," so there is no need for this second load.
Furthermore, NMT level is volatile. That had been necessary in older times since we used to shut down NMT on resource exhaustion. But sinceJDK-8256844, NMT level is fixed at initialization, so we can remove the volatile specifier.
We read the NMT level at every malloc; that is unavoidable. But we also read a second variable that shadows the NMT level `_nmt_was_initialized`. That state is synonymous with NMT level "unknown," so there is no need for this second load.
Furthermore, NMT level is volatile. That had been necessary in older times since we used to shut down NMT on resource exhaustion. But since