High RAM usage with zero traffic

November 26, 2014 4k views

I have 1core/1GB ram and no traffic on the server, installed/running php & postgresql and my ram is used about 95%, is this normal? the same things I was running on the (ovh)VPS and ram was about 100Mb to 200Mb?

top

Tasks: 89 total, 2 running, 87 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 1017984 total, 941744 used, 76240 free, 79380 buffers
KiB Swap: 262140 total, 68 used, 262072 free. 577160 cached Mem

Regards

2 comments
  • Can you please tell us which one consumes the memory? top can help you.

  • First off, let's make sure it's actually used, not just in buffers/cache. Run this, and give us the output:

    free -m
    

    Here's an example output:

                 total       used       free     shared    buffers     cached
    Mem:          7872       7707        165          2        272        432
    -/+ buffers/cache:       7002        870
    Swap:         3967        310       3657
    

    Now, it's showing 165M free. Oh noes. Well, not really.

    Let's look at the 2nd line

    -/+ buffers/cache:       7002        870
    

    It has 870M free. Let's add that with the other free (ignoring the Swap line, if you have one).

    165+870 = 1035 (or ~1GB) free.

    So, in summation, you may not actually be out of RAM. It may just be cached. For more info on caching, go to linuxatemyram.com

1 Answer

This question was answered by @JonsJava:

First off, let's make sure it's actually used, not just in buffers/cache. Run this, and give us the output:

free -m

Here's an example output:

            total       used       free     shared    buffers     cached
Mem:          7872       7707        165          2        272        432
-/+ buffers/cache:       7002        870
Swap:         3967        310       3657

Now, it's showing 165M free. Oh noes. Well, not really.

Let's look at the 2nd line

-/+ buffers/cache:       7002        870

It has 870M free. Let's add that with the other free (ignoring the Swap line, if you have one).

165+870 = 1035 (or ~1GB) free.

So, in summation, you may not actually be out of RAM. It may just be cached. For more info on caching, go to linuxatemyram.com

View the original comment

Have another answer? Share your knowledge.