RFR: 8233494: Avoid calling MallocTracker::record_malloc and record_free when NMT is off

Claes Redestad claes.redestad at oracle.com
Mon Nov 4 13:53:32 UTC 2019


Hi,

this patch removes some small but measurable NMT-related overheads when
when NMT is disabled, by moving NMT_off checks out into MemTracker where
they can be more aggressively inlined.

Bug:    https://bugs.openjdk.java.net/browse/JDK-8233494
Webrev: http://cr.openjdk.java.net/~redestad/8233494/open.00/

Motivation:

Overhead of calling MallocTracker methods account for ~15-25% of
instructions retired by os::malloc/realloc/free. On a "Hello World" on
my laptop (no large pages) we already do roughly 9k os::malloc calls, so
this improvement means a reduction in instructions retired by ~250k, or
~0.2% of the total. There is no discernible difference in behavior or
overhead for the case when NMT is enabled.

Testing: tier1-2

Thanks!

/Claes


More information about the hotspot-runtime-dev mailing list