RFR: JDK-8269571: NMT should print total malloc bytes and invocation count
Xin Liu
xliu at openjdk.java.net
Wed Jun 30 07:27:06 UTC 2021
On Wed, 30 Jun 2021 04:37:33 GMT, Thomas Stuefe <stuefe 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.
I see. I take a look at mallocTracker.hpp. It's unbalanced count.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4622
More information about the hotspot-runtime-dev
mailing list