RFR: JDK-8269571: NMT should print total malloc bytes and invocation count

Thomas Stuefe stuefe at openjdk.java.net
Wed Jun 30 04:41:03 UTC 2021


On Tue, 29 Jun 2021 20:11:08 GMT, Xin Liu <xliu at openjdk.org> wrote:

> your change looks good to me.
> 

Thanks!

> > ```
> >    malloc: 40590KB #13669
> > ```
> 
> I think 13669 is the invocation count of malloc(). Out of curiosity, may I know how to use it? Do you intend to use this to pinpoint memleak from malloc()? A straight malloc() icount may not help much. Is it possible we can have the number of unbalanced malloc()? That is icount of malloc() minus icount of free(). of course, it is not directly related to this PR.

That count is not the invocation counter (which can be useful too under certain conditions) but the number of outstanding allocations.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4622


More information about the hotspot-runtime-dev mailing list