Skip to contentSkip to conversation

How to check for memory leaks

DISCUSSION Larry Finger 4 participants 6 messages Dec 8, 2008 – Dec 9, 2008

lore
Share & tools
lore
#0 lore raw

What is the best way to check if there is a memory leak?

If I start a ping running on my system using the rtl8187 driver, and nothing else active on my system, I see an increase in the "slab" value in /proc/meminfo of about 65 kB/minute. Is this indicative of a memory leak? When I run the same test with p54usb, the increase is only 20 kB/min.

Thanks,

Larry

#1 lore raw

2008/12/8 Larry Finger <[email protected]>:

Quoted 10 lines

What is the best way to check if there is a memory leak?

If I start a ping running on my system using the rtl8187 driver, and nothing else active on my system, I see an increase in the "slab" value in /proc/meminfo of about 65 kB/minute. Is this indicative of a memory leak? When I run the same test with p54usb, the increase is only 20 kB/min.

Thanks,

Larry

Hi,

You could have a look on kmemleak: http://www.procode.org/kmemleak/
It's up to date version is on the arm development git branch (topic kmemleak):
http://www.linux-arm.org/git?p=linux-2.6.git;a=summary

#2 lore raw
Quoted 4 lines · Frédéric Weisbecker

2008/12/8 Larry Finger <[email protected]>:

Quoted 3 lines

What is the best way to check if there is a memory leak?

If I start a ping running on my system using the rtl8187 driver, and nothing

Is this the driver in the staging tree or a different one?

Quoted 20 lines
Quoted 7 lines

else active on my system, I see an increase in the "slab" value in /proc/meminfo of about 65 kB/minute. Is this indicative of a memory leak? When I run the same test with p54usb, the increase is only 20 kB/min.

Thanks,

Larry

Hi,

You could have a look on kmemleak: http://www.procode.org/kmemleak/
It's up to date version is on the arm development git branch (topic kmemleak):
http://www.linux-arm.org/git?p=linux-2.6.git;a=summary
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
Quoted 2 lines · J.R. Mauro

Is this the driver in the staging tree or a different one?

This is the driver in wireless-testing, which is essentially the same as the one in mainline.

Larry

#4 lore raw
In reply to Frédéric Weisbecker
Quoted 5 lines · Frédéric Weisbecker

You could have a look on kmemleak: http://www.procode.org/kmemleak/
It's up to date version is on the arm development git branch (topic kmemleak):
http://www.linux-arm.org/git?p=linux-2.6.git;a=summary

I downloaded the git tree, but x86_64 architecture won't build in the kmemtest branch. I've built an i386 kernel that I will install on a different machine. Once I get that working, I'll try to fix the other problem and post a patch.

Larry

#5 lore raw
In reply to Larry Finger
Quoted 7 lines · Larry Finger

What is the best way to check if there is a memory leak?

If I start a ping running on my system using the rtl8187 driver, and nothing else active on my system, I see an increase in the "slab" value in /proc/meminfo of about 65 kB/minute. Is this indicative of a memory leak? When I run the same test with p54usb, the increase is only 20 kB/min.

Also see cat /proc/slabinfo (you need to compile some debugging feature to get access to /proc/slabinfo).

HTTH,
Hinko

Signature · 6 lines
Hinko Kočevar, OSS developer
ČETRTA POT, d.o.o.
Planina 3, 4000 Kranj, SI EU
tel     ++386 (0) 4 280 66 03
e-mail  [email protected]
http    www.cetrtapot.si