Cleaning up what I am pretty sure is a memory leak..
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.
Cleaning up what I am pretty sure is a memory leak..
Ok, I'm running Slackware 10 w/ kernel 2.6.7. After running for 1 day, 1h, and 9 minutes, my memory useage hits ~50% with BadWM and no windows open. It's done the same with Fluxbox and KDE (although Fluxbox took up more ram, and KDE took up CONSIDERABLY more ram). I have 256mb of ram.
I don't want to have to reboot to free up my memory - what's going on here? I did a ps -eo pid,user,%mem and checked memory usage, but it's all below 1% except for a couple root processes. I don't have enough processes to add up to 50%.
Look at the breakdown of the memory usage using something like
Code:
cat /proc/meminfo
What you have here is probably a large amount of memory being used for hardware caching; if you have any free pages in physical RAM then all block device (disk) reads will be automatically cached (to speed up future reads), causing your memory usage to increase.
This situation isn't a memory leak as such; the cache pages are the first to be reclaimed when an application needs more memory, so you aren't likely to run out of memory because of this.
If you do have a memory leak in any of your daemons, note that most (read: all well-behaved) daemons re-exec themselves, usually once every few hours, which reclaims their heap, including any memory that they have leaked and puts it back in the free store (i.e. this will free all memory leaks). To find the culpret, run
Code:
top
and sort by memory usage. Write it down (or take a screenshot). Wait a day or so, and compare the memory usage now. The process leaking memory will have grown considerably.
yaa that is right. even i had the same problem. i checked it out to be cached content. But what i am surprised is at the memory used by firefox is nearly 92MB and that by an mp3 player is 52MB. Is there any method to lower the RAM usage in these situations. If ever I wish to clean up my RAM, please help me out with suitable commands,
There are no commands to clear out cache memory. However, if more memory is needed, then memory pages used for caching are simply discarded.
The only configuration you've got is /proc/sys/vm/swappiness; if this is set to a high number (nearer to 100) then your system will actually swap program pages to disk in order to increase cache size.
with my desktop machine (no problems in slack 8 or 9, just upgraded to 10 last week) i'm experiencing horrible problems with memory. within a matter of an hour or two, i'm consuming huge quantities of memory and i can't even untar a file at the same time as ANYTHING else ... i can't even issue commands to top or type a single letter in another xterm window. the only way to clear things out seems to be to restart (something that pains me to have to do).
this is after being up for two hours, running x, open office and mozilla, shutting everything down, logging out, and checking out the memory situation. running slackware 9.1 and 8.1 i never had this sort of problem even after being up for 2 months.
i don't have the /proc/sys/vm/swappiness but it seems like it might be a 2.6.x option? are there any alternatives or suggestions on how to free up memory so that i can actually accomplish something? if i have to upgrade to 2.6 i guess i have to, but i'd prefer not to. please let me know what other information to provide. i've never dealt with such an issue before. even my work machine with only 128 mb of ram running redhat and gnome performs better than this machine is right now. heh. thanks!
alright. i logged out of everything, logged in as root (so i wouldn't even have my user processes running), and ran top, output to file and here (in all its ugliness) is what was running.
as you might be able to notice or might not be able to since it's messy, is that there is 1233784k/1551692k usage (roughly 79.5%) even though there is essenially nothing running other than system processes.
i tried to copy a 1mb file from one folder to another on the same partition and that process took approx 30 seconds, during which i could not complete other tasks including switch vt's and type commands.
Jillande: it looks like you have a bone-fide memory leak here. If you don't have the swappiness file then you don't have the kernel patch for hardware caching as described above.
I'd start investigating this by running top, then press F and sort by %MEM.Look at the process that's eating most of your memory; you are likely to need to shutdown and/or upgrade this in order to make your system usable.
Also, check to see if you have any tmpfs partitions mounted, eg. on /tmp/ as some processes might be using that as a free storage space and hence eating your RAM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.