On Fri, 11 Mar 2022 06:50:00 GMT, David Holmes <david.hol...@oracle.com> wrote:
> I can combine the tests for `MemTracker::tracking_level()` and > `DumpSharedSpaces` into a single test and do more work only when the uncommon > path is taken. This would require some refactoring of the > MemTracker/MallocTracker code. I'd rather do that in a separate RFE. > > In fact, `MemTracker::_tracking_level` is tested twice in the current > implementation. We can change it to do a single test in the most common case > (NMT_summary) if we really want to cut down the number of tests. But honestly > I don't think this makes any difference. > Before going down that road, I would really like to see some measurements, whether this really matters. malloc is not blindingly fast. The malloc code in glibc does test a lot of conditions too. If you need fast allocation (or well packed, for that matter), you need another allocator. Thats why we have Arenas. ------------- PR: https://git.openjdk.java.net/jdk/pull/7748