lkml.org 
[lkml]   [2008]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateTue, 29 Apr 2008 09:58:35 -0700 (PDT)
FromChristoph Lameter <>
SubjectRe: detecting kernel mem leak
On Tue, 29 Apr 2008, Pekka Enberg wrote:

> 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).

For slub: Just enable debugging and then do a cat on
/sys/kernel/slab/<cachename>/allocs or frees to see where memory is
allocated or freed.


> Christoph, I suppose there's some option to
> Documentation/vm/slabinfo.c that provides similar output to
> CONFIG_DEBUG_SLAB_LEAK for SLUB?

If you run a report on a slabcache with f.e.

slabinfo kmalloc-2048

and debugging is enabled then all functions that allocate and free objects
in kmalloc-2048 are listed.

Just doing
slabinfo

list all caches with the number of objects allocated.



\
 
 \ /
  Last update: 2008-04-29 19:01    [from the cache]
©2003-2010