[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: memory leak

In a message <tko@westgac3.dragon.com> wrote:
| Something that I'm running is leaking memory like crazy. How do I
| find this memory leak and more importantly, how does one fix it? I
| have 128Meg of memory on the system and when I first boot up, the
| system has 99Meg free. After running for a day or two, I'm dipping
| into the swap space and the /proc/meminfo shows 90 Meg tied up in
| "buffers:" 

Are you positive that you're using swap? "buffers:" is just disk
cache. Linux, and most other Unices, and I think even Win95,
dynamically adjust the amount of disk cache used based on how much
memory your system has and how much is being used. What's supposed to
happen is that as your applications, or the OS for that matter, ask
for memory Linux is supposed to shrink the amount of disk cache to
some minimum value. When your applications are finished then Linux
will, again, gradually start increasing the disk cache. Also, swap is
not only used as virtual memory, if an application is idle for a time
and not accessing the memory it's allocated Linux can swap it out.

I'm not saying you don't have a leak. K&R knows I've written my share
of memory leaking monstrosities, but it's pretty tricky to narrow
something like that down under a sophisticated OS like Linux. I would
imagine, if you're convinced you have a leak, judicious use of "ps"
could help.

Good Luck!

To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: