Messages in this thread |  | | | Date | Tue, 29 Apr 2008 09:58:35 -0700 (PDT) | | From | Christoph Lameter <> | | Subject | Re: 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.
|  |