# HORRIBLE Memory Leak

## Ustanik

I have an AMD Athlon 3000+ 64 with 768MB of RAM.

It ALL  gets eaten by Linux in NO time at all.

I've compiled the 64-bit version of Gentoo.

I'm running stable with the exception of a couple applicatins.

I've compiled my own kernel.

When my computer boots up, it mounts the /home directory via NFS from my notebook.

It then starts into GDM.

I log in with my default user account, it's /home directory is on the 64-bit machine via NFS.

I run 2 video cards and have dual head monitors with Xinerama off.

When GNOME starts I launch these applications in this order:

     gdesklets 0.26.1 (I have 3 desklets:  pager, starterbar, tasklist) [gdesklets requires a lot of python based libraries.  One of them is pyxdg which is in the unstable tree]

     gaim 1.0.2

     firefox 1.0-pre-r2

Applets I have running on my GNOME panels that might matter are:

     sticky notes (I use a lot of these)

     system monitor

By this time, after just loggin in and launching 3 applications my RAM utilization is at 100%.

And NO, this is NOT cache.  Only about 5% of this 100% utilization of RAM is cache.

What can I do to fix this?

Thank you.

----------

## adsmith

first step is to run "top" and hit M (capital) to sort by memory usage.. see what's taking it up.

another step is to check the swappiness setting, which can make memory seem to be acting funny if outside of normal bounds.

It is possible that it is actually cache/buffer, since memory management has changed a bit recently, and some system monitors haven't caught up.  For instance, my 768M machine now says 40% RAM used, but only about half of that is actual programs/processes.

----------

## dsd

and let us know which kernel you are running

----------

## Ustanik

I'm running kernel 2.6.7

I also updated my system.  There was a required update for xorg.  This new update seems to have fixed my memory leak.  Running all the same programs my RAM utilization is now at 52% with 10% of that being cache.  

Before hand though, top and then M, showed all my RAM was being used but the numbers for each running application did not add up.

Now that I updated my system...gaim is broke    :Sad: 

Thanks for the help everyone.

----------

## rizzo

 *Ustanik wrote:*   

> Now that I updated my system...gaim is broke   

 

emerge gaim >= 1.1.0

----------

## zerojay

Linux always attempts to use all RAM all the time, using a good amount for not only cache but for buffers as well.

----------

## Ustanik

Going slightly off topid:

I upgraded to Gaim 1.1.0 - it works nice but I'm always weary of using something marked as unstable. . .

I'm dying to get GNOME 2.8 but it's still unstable for amd64.  Would I risk comprimizing my system?  If I do decide to go with it, do I only have to mark gnome to install as unstable or every application that comes with it?  

So, do I dare?   :Smile: 

----------

## mattlant

I have the exact same problem with memory. And it is NOT the buffers. eventually swap space starts to get used untill it gets full, then a hard crash. 2.6.9-r9 gentoo-dev sources. I have a gig of ram. This has now happened twice. I installed first time around from stage 1, not too aggressive clags, sytem was stable till it started to run out of mem. then i reinstalled, from scratch yet again, played with use/cflags, and its happeneoing yet again.

I could have the system startup, load up X, open NOTHING, walk away for the night and the next day 900 MB will be used. SInce this is the second time its happeneing, i dont know that its my fault. :/

Funny thing is, no processes show that they are using the ram. But i know it runs out when HD activity sky rockets, system lags, check mem, and swap usage is almost full, mem is full, and then a hard crash. 

also, sysgaurdapplet shows the mem as app mem, so does free, yet if i shut down almost every single process i can, no mem gets released.

Could this be a kernel issue? something else? i dunno, but i am getting very frustrated with  it. I even just yesterday reduced cflags more to just march=pentium4, -pipe, -02 and upgraded to gcc 3.4.3 and recompiled everything, and it still happens.

ANyone have any thought? any other info you want form me?

Thanks

----------

## mattlant

Just something interesting to add to this...

I was using ssh to connect to another box I am installing gentoo on, and I was decompressing a stage 2 file. ssh was thru a Konsole window. before uncompressing, my LOCAL mem usage was at ~400MB (with only konsole and konqueror open, lol) and afterwards it was at 430 MB. seems the scrolling of the buffer in konsole was wasting ram, even though most of the buffer cleared as it scrolled.

Something is really screwy somewheer. that 30 MB, just went into a black hole as I have not got it bak, even after exiting ssh and konsole :/

EDIT: well maybe it had nothing to do with konsole, because in the 3 minutes it took to write this another 30 MB is gone    :/

----------

## mattlant

ok, well, I think i have narrowed it down a bit. It seems that mem dissapears whenever ther eis network activity, ssh, surfing web, copying files via nsf,smb (both from cli and thru konqueror)

Maybe bad networkj drivers? I have a VIA mobo with the Rhine II chipset, using the built in rhine drivers, last gentoo buld i used genkern, so it was a module iirc, this time around i built the kernel and its built in.

Matt

----------

