While investigating the performance of os::malloc, I found that we spend considerable time in the NMT enabled check. This is bad, since this hits every execution path unconditionally. On x64 it uses a locked load. That is caused by NMT level being a volatile.
We need to investigate if this is still needed. NMT level used to get modified on the fly (NMT shutdown) but we simplified that NMT protocol a lot over the years. Nowadays the level should - in theory - only be set in VM initialization, after which it should never change. We can probably just remove the volatile, but I need to check first.
We need to investigate if this is still needed. NMT level used to get modified on the fly (NMT shutdown) but we simplified that NMT protocol a lot over the years. Nowadays the level should - in theory - only be set in VM initialization, after which it should never change. We can probably just remove the volatile, but I need to check first.
- relates to
-
JDK-8296437 NMT incurs costs if disabled
-
- Resolved
-