3

Possible Duplicate:
Correctly determining memory usage in Linux

I see that almost all my RAM is in use. Is this bad? Strange thing is I don't see what is actually using the RAM.

enter image description here

MetaGuru
  • 719

2 Answers2

7

No problem in that. Linux is borrowing the RAM for caching. This is desirable (RAM is faster than disk) and absolutely normal behaviour.

From that link:

Why does top and free say all my ram is used if it isn't?

This is just a misunderstanding of terms. Both you and Linux agree that memory taken by applications is "used", while memory that isn't used for anything is "free".

To see how much RAM you have free, type free -m and look at the -/+ buffers/cache line. In my machine, for example:

 $ free -m
             total       used       free     shared    buffers     cached
Mem:          5868       4031       1836          0        282       2260
-/+ buffers/cache:       1489       4379
Swap:         6143          0       6143

Thus I'm using about 1.5 GB RAM, not 4 GB as the first line might make it look like.

Renan
  • 17,136
1

Its mostly linux caching data. If you use free -m look at the row -/+ buffers/cache: to see the non cache memory used/free

  • Awesome, this makes sense now. It shows 6226 free according to this, which matches up with how much Java is using there. Thanks! – MetaGuru Sep 25 '12 at 01:33
  • 1
    cool, accept the other one tho cause i wrote this quickly thinking maybe others would write an over the top explanation or something that isnt simple to understand. –  Sep 25 '12 at 01:37