Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently switched from xfce4 to KDE 3.5, and I've started noticing that X's memory usage slowly crawls up during normal use. It starts off at maybe 40 MB, and over the course of 2 or 3 hours crawls up to the hundreds of MB. Right now it's at 461, but I've seen it as high as 650 (at this point my computer, which has 1 GB of memory, tends to crap out).
This could very well have been happening before KDE, but if so, I didn't notice it. I'm not doing anything special with the system. Mostly just running Eclipse, Firefox, and amaroK.
I'm using xorg-x11 6.8.2. I also recently upgraded my kernel from 2.6.13 to 2.6.14.
Any ideas what's going on? Google says it's normal for X to take up a lot of RAM, because it "maps it to other things, blah blah blah". But 460 is a bit excessive, isn't it? I might as well go back to XP.... maybe I'm seeing some sort of memory leak?
Yes, but how much ram are you REALLY using for apps and how much is just spare buffers and cache? Show the output of the free command... Chances are you are not really using much ram at all, rather it is the normal use linux makes in cache and buffers... Linux tends to use ALL ram available. What is the point of having ram just sitting there rather than use it for something... You paid good money for that ram.
And there is no reason for a machine to 'crap out' when using that little amount of ram unless the ram is faulty. What do you mean by 'crap out'? I only have 512 meg, which is in full use all the time eg:
Note that 489 meg is used, but 212 meg of the ram is in buffers and cache and so still 'available'... Of course I'm swapping a bit here do to the application load...
Looks like I've got plenty of usable free memory there.
By "crap out", I mean that when the memory graph running in my KDE panel shows that there is no more free memory (i.e. application memory is at or near 100%, not the cached or buffered stuff), the swapping goes into overdrive, and X becomes essentially unresponsive. Sometimes I can get out by Alt+Ctrl+Backspace, but usually I'm just forced to reboot.
Up until now I assumed it was the X issue, but I guess I've just been running too many applications at the same time (it usually seems to happen during gcc compiles, so maybe that).
Quote:
Originally Posted by amosf
Yes, but how much ram are you REALLY using for apps and how much is just spare buffers and cache? Show the output of the free command... Chances are you are not really using much ram at all, rather it is the normal use linux makes in cache and buffers... Linux tends to use ALL ram available. What is the point of having ram just sitting there rather than use it for something... You paid good money for that ram.
And there is no reason for a machine to 'crap out' when using that little amount of ram unless the ram is faulty. What do you mean by 'crap out'? I only have 512 meg, which is in full use all the time eg:
Note that 489 meg is used, but 212 meg of the ram is in buffers and cache and so still 'available'... Of course I'm swapping a bit here do to the application load...
Probably still shouldn't happen.
I'd go with more swap as a short-term fix; note the ratio of mem-to-swap on your system compared to amosf.
Add another Gig of swap - you can have more than one, so just create another and add it to fstab.
See how it goes after that.
Ram use looks good, though it does seem to be swapping a lot considering the amount of ram you have... I'd also suggest adding more swap. You should be able to run a lot of apps, I run 12 virtual desktops and often have at least one app in each. You may have some app with a memory leak that is chewing memory... mozilla and firefox can eat the ram at times...
Anyway, the swap use is a good indicator that you probably need more swap space, so as said above you probably should add a gig of swap and see what happens (you can add a swap fil if you don't have partition space, see man mkswap) If it's still chewing most of the swap, then there is something not quite right.
It seems odd that you are using that much swap and yet have good ram use. Do you start and end some big apps or big 3D game perhaps?
By the way, I wasn't just seeing things afterall. I've had X running for a few days now, and it is now taking up 319 MB of memory--not just cached/buffered/swap stuff, but actual physical memory (or so KSysGuard tells me).
With no applications other than firefox running my `free -mt` output looks like this:
Firefox does tend to chew up the ram... But it does seem you are using a lot of ram and too much swap unless you are running a lot of apps. I'm only using about 250 meg ram (actually used) and no swap, and I'm running kmail, knode, firefox, and several terms... So if you are just running firefox then it does seem you are using a bit much...
Well two months later, I'm still having memory issues in Liux. I find myself restarting X daily, because after a day's uptime my memory use slowly creeps up to 100% and eventually my system becomes unresponsive (i.e. more and more swap use, until everything is being swapped constantly).
Right now I have NOTHING running except X -- no other active applications, except for the usual KDE trinkets (I'm writing this from another computer) -- and the KDE System Guard applet is showing my Application Memory as using about 60%, while Buffered and Cached memory are using maybe 10% at most.
Something is wrong here. I think the culprit may be Eclipse or SWT. Are there any known memory leak issues with Eclipse/SWT? I should add though that I only really started noticing this memory problem after I switched from Gnome/XFCE4 to KDE.
P.S. I've also now increased my total swap to 1.5 GB, so that can't be it.
Does this mean that 411 MB of that 652 IS in fact buffered/cache? If so, why is the KDE System Guard showing this as "Application" memory rather than "Buffered" or "Cached" memory?
That definately sounds like a memory leak, as something this critical would have been picked up by many other X users a long time ago. Maybe it is a wayward process or some KDE app that isn't doing so well. Perhaps watch "ps -ef" and "top", and maybe try some sort of memory profiler for each app.
Personally I haven't had any memory leak issues with Eclipse or Firefox. Their RAM usage does go up as you do more, but just letting it idle shouldn't somehow suck up RAM.
there was a time right after xfree4 came out with new modular design when x had a huge memory leak in it.
given the general level of instability introduced by xorg i would say for your setup you have a bad memory leak in x. try other video driver or new/older version of xorg. Or better yet try xfree86.
xrestop is showing X as only using 17 MB total... top shows X as using 378 MB... this is (sort of) confirmed by free -mt, which shows that I am using 772 MB, 476 of which is in buffers/cached, meaning that i'm still using up about 300 MB for god knows what.
Since nothing shows up in xrestop, I'm not really sure what's going on... I should mention this happens with both the radeon and fglrx drivers, so I don't think that's it... My last hope I guess will be to try XFree86 instead of xorg......... or i can just kick these headaches good by once and for all and go back to Windows
Note the comment on the homepage re underestimating pixmap memory usage.
BTW, I've never used it, merely came across it some time ago in my wanderings ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.