2

After a fresh install of a debian VPS, my system shows very low memory being used. I am not sure if this is even a issue. But according to 'free -m' My system is using only 21MB of RAM

             total       used       free     shared    buffers     cached
Mem:           512        510          1          0          0        488
-/+ buffers/cache:         21        490
Swap:          512        435         76

This is a small debian 7 VPS with 512MB RAM running postgresql/php/lighttpd

I am concerned because resource intensive queries are running in the background when the output shows only 21MB ram being used.

Even when postgresql is shutdown, free -m still shows the same. Infact the output of free -m hasn't changed much ever since the fresh install of the VPS took place.

Right now I am running lighttpd / postgresql / sphinxsearch / php etc.

So is such low RAM usage normal ?
If not what could be the possible reasons for this ?

Thanks

Edit: I am talking about low RAM usage, and not high RAM usage as pointed in linux ate my RAM.

gyaani_guy
  • 171
  • 1
  • 1
  • 8

1 Answers1

0

I think you're misreading the memory usage a bit. Small actual memory usage can be normal, however in your case more is going on.

According to your "free -m" output:

The total memory is: 512 MB
Used memory: 510 MB
Free memory: 1 MB
Cached memory: 488 MB

Total swap: 512 MB
Used swap: 435 MB <-- Worry about that!
Free swap: 76 MB

Since you are using almost all of your swap your system is partially running from swap and performance may be severely degraded. Being worried is good in this case, but you're worried for the wrong reasons. Trust that the memory usage reported is correct, make sure to interpret it correctly.

In theory the free to use RAM could be 488 + 1 = 489MB, being the free and cached memory added up.

I think all these queries are eating up the memory in the form of cached memory (still available for processes though) and then most of the swap as well, which as I said will degrade performance. And what is the guarantee actual processes are not (partially) running from swap, or needing access to swappped memory?

Fix the query thing is my advice, and don't worry about whether the kernel reports memory usage correctly, I am fairly confident it is correct. :-)

aseq
  • 4,610
  • 1
  • 24
  • 48