malloc(9) statistics.
Robert Watson
rwatson at FreeBSD.org
Wed Jul 27 23:06:45 GMT 2005
On Wed, 27 Jul 2005, Pawel Jakub Dawidek wrote:
> I spend few hours today tracking memory leak. At the end I found, that
> there were no memory leak actually, but memory statistics are confusing.
>
> Command 'vmstat -m' shows number of allocations in column named "InUse".
> Coulmn name is wrong and confusing. The column only shows how many
> allocation were there (successful or not), so when malloc(..., M_NOWAIT)
> fails, it increases InUse value, which is never decreased, because there
> will be no corresponding free(9).
>
> I've two proposals:
>
> 1. Don't increase allocations counter on failure:
>
> http://people.freebsd.org/~pjd/patches/kern_malloc.c.patch
I think this makes more sense, and the problem is due to a
mis-understanding of mine regarding how malloc(9) internally accounts for
allocations. Feel free to commit, and MFC in short order to RELENG_6.
> 2. Change "InUse" name to something else.
(1) since InUse is a useful concept.
Thanks!
Robert N M Watson
More information about the freebsd-current
mailing list