From: Baruch Even <baruch@ev-en.org>
To: Matt Mackall <mpm@selenic.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] /proc/kmalloc
Date: Mon, 21 Feb 2005 02:43:44 +0000 [thread overview]
Message-ID: <42194AE0.2040209@ev-en.org> (raw)
In-Reply-To: <20050220204743.GE3120@waste.org>
Matt Mackall wrote:
> I've been sitting on this for over a year now, kicking it out in the
> hopes that someone finds it useful. kernel.org was down when I was
> tidying this up so it's against 2.6.10 which is what I had handy.
>
> /proc/kmalloc allocation tracing
>
> This quick hack adds accounting for kmalloc/kfree callers. This can
> aid in tracking down memory leaks and large dynamic memory users. The
> stock version use ~280k of memory for hash tables and can track 32k
> active allocations.
One thing I've seen once that might be worth adding is the ability to
mark generations and then ask "what allocations exist from generation x?".
So you do something like:
echo 5 > /proc/kmalloc_generation
run some tests
echo 6 > /proc/kmalloc_generation
Print all allocations from generation 5:
echo 5 > /proc/kmalloc_print_generations
Now you get all buffers that were allocated in generation 5 and not
released. Not all of these are leaks, but it's easier to wade through
this list to see what is and what isn't a leak.
Sometimes it's better to summarize all allocations according to the
caller who asked for the allocation, it makes it easier to see if there
is an undue increase from certain callers.
Just some ideas.
Baruch
next prev parent reply other threads:[~2005-02-21 2:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-20 20:47 [PATCH] /proc/kmalloc Matt Mackall
2005-02-20 21:59 ` Arnd Bergmann
2005-02-21 2:43 ` Baruch Even [this message]
2005-02-21 13:53 ` Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42194AE0.2040209@ev-en.org \
--to=baruch@ev-en.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox