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 have a virtual server with 512MB RAM. It is running CentOS 5.3 (with no GUI). It is a bare minimum install, only what I need is installed. It is still not in production, so no one is connecting to the server other than me.
After installing and starting all the server software, the server has about 200 MB of free RAM. Slowly after time, there is less and less RAM available. At one point there was only 5 MB available. When I do a ps -aux, there is very little memory being used by all the running processes. I ran an awk script to add up the %MEM column and it added up to 57%.
It seems like as memory starts getting used, it is never released or freed up. For example, I ran free and saw the amount of free RAM. Then I ran mysql client and made a quick update to 1 field and quit the client. The amount of free memory went down by 5 MB and never went back up.
I've tried restarting all the server software and it recovered about 40MB. However, if I restart the server, it goes back to about 220MB free. And once again, with time (and I repeat, no one is connecting to this server and using any processes) it goes back down to 20 or 30 MB free.
This is what is installed/running:
MySQL
Postfix (with MySQL support)
Dovecot
Spamassassin
Saslauthd
Daemontools
tjbdns
Apache with PHP (compiled from source with all modules disabled except a couple required ones)
OpenSSH
The first time it went down to 5MB, Apache + PHP were not installed yet, so I don't believe they are the cause.
I have a second server which is almost identical. The only different is that it isn't running daemontools and tjbdns, and it is not having this problem. However, all the daemontools and tjbdns processes are using 0.0% of MEM. This is also the first time I install daemontools and tjbdns.
Any ideas what might be happening? What can I do to troubleshoot/debug this?
Any ideas what might be happening? What can I do to troubleshoot/debug this?
LQ is full of posts like this [Search for them]
linux uses RAM much more efficiently than windows. Ideally there should be no "free" RAM as "free" RAM is "wasted RAM" when it can be used for buffers to improve speed. If a process requests RAM that's not "free", then buffers will be flushed to give it the RAM it needs.
This still seems a little odd to me since all the other linux servers I've setup in the past have not done this. My concern is that when new memory is needed, it will not release the "unneeded used" memory. It would just make more sense to release the memory when it is no longer in use.
Anyways, I have left the server alone (in terms of watching the memory). I just checked again, and the free mem has kept going down, and it is now usinig 21MB swap. And this is still with no use (no connections to the server other than my ssh connection).
I have searched google and several forum sites (including this one) and I am not finding what I am looking for. What search terms would you recommend would find threads with an answer to this issue?
As others have said, its not an issue unless you start thrashing (heavy usage of swap).
All the current versions of Linux use more-or-less the same kernel 2.6.xx, and most probably use the same scheduling/vm subsystems.
In essence, unused RAM is wasted RAM
Linux will cache as much as it can.
It WILL release those caches if it needs to.
It doesn't flush the RAM just because it's not being used, that would be unnecessary work; after all, if you don't need(!) it, why waste cycles flushing it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.