Messages in this thread | | | Date | Tue, 29 Apr 2008 15:46:42 +0300 | From | "Pekka Enberg" <> | Subject | Re: detecting kernel mem leak |
| |
On Tue, Apr 29, 2008 at 12:41 PM, <sancelot@free.fr> wrote: > I noticed the memory was growing without doing anything in my system ....after > some investigations , it looks like some kernel components may be involved in > this problem. > > I would like to know if there is a way to monitor activity of memory (de)alloc > of the kernel in order to target which partof the system/kernel could do this..?
You can do
cat /proc/meminfo | grep Slab
and if that grows too much over time you can do
cat /proc/slabinfo
or use a tool such as slabtop to see where the memory is going. If the memory is being leaked in the kmalloc caches, you can use CONFIG_DEBUG_SLAB_LEAK which part of the kernel is doing all those allocations (not really suitable for production machines).
Also remember to check that Active + Inactive + Buffers + Cached is roughly the same size as MemTotal - MemFree; otherwise your kernel might be leaking full pages.
Christoph, I suppose there's some option to Documentation/vm/slabinfo.c that provides similar output to CONFIG_DEBUG_SLAB_LEAK for SLUB?
Pekka
| |