vayapues
Oct 1 2007, 01:32 PM
Looking at my memory via shell using the top command, I noticed that the server was using 95% of the available RAM. I decided to take advantage of the planets promotion to double something for free, so I went ahead and got a new box setup with double the ram.
Now, top is still showing that the server is using 95% of the available ram. It was very high, even before I put any sites on it.
The load is low, only around 0.07, and everything comes up fast. However, if I truly am at 95% of my RAM, I worry that I don't have much room to grow.
Any thoughts? Why would my memory usage shoot up so high, almost double what it was before the upgrade.
Thanks kindly
ajz4221
Oct 1 2007, 05:09 PM
I am a Windows admin but I think I can remember some linux stuff (even though it hurts my head to do so)...haha
In the GUI, try CTRL ESC in some environments (such as KDE).
Command line:
ps -ax |more
ps -aux |more
The goal is to see what process(s) are using the most RAM (such as what task manager does in Windows).
DISCLAIMER: I may not know what in the world I am talking about...don't break your server.
James Jhurani
Oct 1 2007, 08:39 PM
Reading the usage may be a little tricky. The best way to tell how much RAM you have free is to type "free -m".
[root@core ~]# free -m
total used free shared buffers cached
Mem: 439 433 6 0 33 238
-/+ buffers/cache: 161 277
Swap: 895 63 832
[root@core ~]#
While it may appear that I only have 6MB free from this output, it is really not the case. The number you want to be looking at is in the -/+ buffers/cache line, the number to the right. In my case it is 277MB.
I would also suggest that you make sure you have some swap space, so old pages can be written to swap, and not left in active memory.
Tomy Durden
Oct 2 2007, 09:55 PM
Yeah, the way linux reports memory usage is a bit wonky. The system will use alot of the RAM for disk cache and reallocates as applications need it. Often, you don't know you're actually out of memory until you see the swap is being used.
To expand on Jame's explanation of free, that number(277) is the amount free for allocation from an application's perspective. Everything between that number plus the used cache and the physical total is being used by the kernel, which can't be swapped out of memory.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.