LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Kernel memory leak. slab debug. (https://www.linuxquestions.org/questions/linux-kernel-70/kernel-memory-leak-slab-debug-4175458373/)

hellolinux 04-16-2013 05:43 PM

Kernel memory leak. slab debug.
 
Hi,

I have a question about how to find a memory leak in the slab.

I am using a Windriver linux distribution and noticed that free memory was going down. After I enabled slub_debug, I noticed that the buf_acquire is allocating the memory and skb_release_data is freeing it (see below). The numbers (buf_acquire, skb_release_data) seem to match but the # of active objects keeps on increasing until there is no memory left. How can I proceed further as to why the slab is not being freed?

Thanks for your help.

from slabtop: 349594 281787 80% 4.07K 49942 7 1598144K kmalloc-4096

sort -n /sys/kernel/slab/kmalloc-4096/alloc_calls 259945 buf_acquire+0x30/0x70 [tipc] age=251/2199820/3285324 pid=3789 cpus=0-7

from /sys/kernel/slab/kmalloc-4096/free_calls 260208 skb_release_data +0x85/0xd0 age=1499/2291151/4037734 pid=4722-31618 cpus=0-7

Onnonymous 04-17-2013 04:11 AM

When I notice strange kernel related problems, first thing I try is booting with another kernel version (preferably much older or much newer). This may not be the detailed answer you're looking for but I hope it helps.

jpollard 04-17-2013 05:44 AM

One thing to remember is that Linux will use the entire "unused" memory for buffers. If nothing needs the space, it will just remain. If new processes (or I/O) needs memory it will flush these buffers and reuse the space.

The major identification of a kernel leak is when your system hangs...


All times are GMT -5. The time now is 06:31 AM.