JDK-8261238: NMT should not limit baselining by size threshold #2428
Conversation
|
Webrevs
|
6f98dbe
to
4d35243
The threshold was put in place purely due to memory consumption concerns. |
Great, Zhengyu, thanks! |
Mailing list message from David Holmes on hotspot-runtime-dev: On 9/02/2021 2:29 am, Thomas Stuefe wrote:
To know if this is still a concern we know to know what the original David |
Yes, it would be helpful to know what the initial memory requirements were as well as the considerations behind it. NMT tries to be very slim; which is good, but at various places we trade performance for memory footprint (eg. live with a load factor of 5+ in the malloc site table rather than spending an additional 4-12K to broaden the table). Without knowing these requirements and without deciding if they are still valid improving NMT is difficult. |
I am currently working on a patch which reduces cost of baselining: https://bugs.openjdk.java.net/browse/JDK-8261491 which should be more than enough to mitigate the modest footprint increase of this patch. So, can we get this patch approved please, unless there are other technical considerations I am not seeing? |
I split out non-controversial display changes into JDK-8262165. |
Gentle Ping. |
NMT is a very useful tool to detect memory leaks. Its easy to use, relatively cheap and requires almost zero setup.
But it artificially limits output to call sites with >1K total memory consumption. That is not helpful, as it confuses the developer and obscures possible memory leaks. It also introduces subtle display errors in that callsites suddenly seem to appear, when comparing to the baseline, with a load of >1K when in fact they had been there already when the baseline was taken.
I propose to remove the 1K limit completely. This will marginally increase the costs of taking "detail" NMT reports by about 210K for a single report, 420K for a report done using a baseline.
If this is really a problem preventing us from getting more precise NMT output (really?) there are possibilities to decrease the cost again by sharing call stacks by reference instead of copying them around. I have a patch in work which does just that (https://bugs.openjdk.java.net/browse/JDK-8261491), but I honestly think adding 200-400K temporarily during NMT detail reporting would not be such a big deal.
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2428/head:pull/2428
$ git checkout pull/2428