Re: is this a memory leak ?

From: Kasper Dupont (remove.invalid_at_nospam.lir.dk.invalid)
Date: 07/15/04


Date: Thu, 15 Jul 2004 17:41:37 +0200

gopan wrote:
>
> We were suspecting that our driver is some how leaking memory,
> (in our driver we use only kmalloc for memroy allocation) but what we
> observe is as soon as the first OOM killer runs, if we terminate all
> the client
> sessions in the linux box, the machine which has our switch is able to
> recover memory, ie at the time of the OOM killer if the free memory
> was around 6MB, on killing all the client-server sessions, the free
> memory goes up to 30 MB (total memory is ard 64 MB).

If I understand this right you are in fact able to
free the memory again, in which case it cannot have
been leaked. Could it be the kernel is using a lot
of memory for connection tracking or something else?

Did you read this? Does any of it help?
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#memleak

>
> Now, if it was our driver leaking memory then there is no chance of a
> memory recovery on killing few user programs right ? .

Right, if the kernel is leaking memory, the only
way to free it again is by rebooting.

> but if it is
> not a memory leak in the driver, i believe the kernel it self should
> have killed the required number of netservers and got some free
> memory.

Only if it is in fact consumed by user space. On
machines with 1GB of memory it is not unusual to see
100MB or more used for kernel data structures. Of
course on a system with less memory the kernel should
not try to allocate so much for its own use, but there
might be a bug somewhere.

> So, what could be the possible reasons for this memory
> starvation ??

Try to find out a litle more about what the memory is
being used for.

-- 
Kasper Dupont -- der bruger for meget tid paa usenet.
I'd rather be a hammer than a nail.


Relevant Pages