Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 04-16-2013, 06:43 PM   #1
LQ Newbie
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
Kernel memory leak. slab debug.


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
Old 04-17-2013, 05:11 AM   #2
LQ Newbie
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
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.
Old 04-17-2013, 06:44 AM   #3
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,711

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
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...
1 members found this post helpful.


leak, memory

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool to identify memory leak in loadable kernel module appas Programming 3 06-05-2012 10:56 AM
how to test kernel memory leak using dmalloc laginagesh Linux - Kernel 2 06-11-2010 03:28 PM
Memory leak in Linux kernel kiran_4u Linux - Kernel 1 08-25-2009 01:50 PM
Memory / Kernel leak? Snipersnest Linux - Newbie 11 02-08-2005 05:10 PM
kernel memory leak? linux7 Linux - General 1 10-16-2004 12:48 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration