Is my Linux machine running low of RAM? [closed]

Posted on

Problem :

Here a output of “free -m” from my machine, I don’t know if this means that RAM is low:

root@mymachine:~# free -m
             total       used       free     shared    buffers     cached
Mem:          4048       3929        118          0          4        661
-/+ buffers/cache:       3263        784
Swap:          255        100        155

Also I added below output of top “command”:

top - 10:05:10 up  2:46,  1 user,  load average: 1.76, 1.83, 1.76
Tasks:  80 total,   1 running,  79 sleeping,   0 stopped,   0 zombie
Cpu(s): 16.1%us,  4.0%sy,  0.0%ni, 51.9%id,  2.8%wa,  0.0%hi,  0.8%si, 24.4%st
Mem:   4145552k total,  4025128k used,   120424k free,     4812k buffers
Swap:   262140k total,   113196k used,   148944k free,   688328k cached

 3904 root      20   0 2452m 2.1g 3964 S  111 53.9  56:31.72 java
 1999 mysql     20   0  170m  33m 2660 S   76  0.8  36:14.09 mysqld
 2420 root      20   0 2439m 944m 3636 S    1 23.3   8:02.11 java
 9716 root      20   0  2464 1068  828 R    1  0.0   0:00.03 top

Solution :

Firstly the definition of low is somewhat subjective, it depends on what else you may intend to run.

An important point to bear in mind when viewing the output of free is that the first line includes all the buffered content (which is imediately discarded if more memory is needed), this means that you should look at the second line to find the ‘actual’ free memory. In this case it’s 784 MB (~20% of your total).

As mentioned your swap space is quite small compared to your ram, while the old advice of 2 times physical ram for swap size is not really needed now, I think you’d be better off with a larger swap space, particulary since you’re not so far off maxing out your ram.

The real answer to your question is that it depends on the situation!

Leave a Reply

Your email address will not be published. Required fields are marked *