1

I am operating a small Linux VM with 1Gb of RAM.
It is a fairly typical LAMP setup which takes about 16% of memory on normal usage

I used the box to compile stuff yesterday, the memory went up to 60% and didn't drop back.
A memory sorted "top" doesn't show anything else than Mysql and Apache:

top - 09:41:33 up 4 days,  6:41,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  41 total,   1 running,  40 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:   1048576 total,   640072 used,   408504 free,        0 buffers
KiB Swap:   131072 total,        0 used,   131072 free,   533872 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
 2042 mysql     20   0  385m  41m 7324 S   0.0  4.1   9:25.35 mysqld
 1680 bind      20   0  117m  21m 2468 S   0.0  2.1   0:03.07 named
 2155 root      20   0  191m  10m 4988 S   0.0  1.1   1:07.43 apache2
12507 www-data  20   0  192m 9740 3032 S   0.0  0.9   0:00.50 apache2
12505 www-data  20   0  192m 9728 3020 S   0.0  0.9   0:00.19 apache2
12481 www-data  20   0  192m 9652 2940 S   0.0  0.9   0:01.47 apache2
12508 www-data  20   0  192m 9648 2940 S   0.0  0.9   0:00.73 apache2
12499 www-data  20   0  192m 9640 2932 S   0.0  0.9   0:00.24 apache2
12509 www-data  20   0  192m 9636 2928 S   0.0  0.9   0:00.26 apache2
12564 www-data  20   0  192m 9624 2924 S   0.0  0.9   0:01.07 apache2
12563 www-data  20   0  192m 9600 2928 S   0.0  0.9   0:00.33 apache2
14624 www-data  20   0  191m 7492 1296 S   0.0  0.7   0:00.30 apache2
14629 www-data  20   0  191m 7352 1248 S   0.0  0.7   0:00.24 apache2

Where did the missing 400Megs go?
Is this something that I should worry about or just wait for my scheduled weekly reboot?

For clarity, the "stuff" was Google Protocol Buffer which doesn't use any daemon.

  • 1
    Read Linux ate my RAM. Remember, free memory is wasted memory. – Gilles Aug 28 '14 at 21:57
  • @Gilles Wow, a guy actually created a website dedicated to this question :) – MonoThreaded Aug 29 '14 at 10:09
3

The “missing” memory is serving as cache (mentioned in the top output at the end of the line that starts with the swap). You can use free to see this in a different form:

$ free
             total       used       free     shared    buffers     cached
Mem:       1048576     640072     408504          0          0     533872
-/+ buffers/cache:    106200      942376
Swap:       131072          0     131072
  • How do you read the second line? – MonoThreaded Aug 28 '14 at 8:50
  • That is used - (buffers + cache) and free + (buffers + cached). Giving the values: 12547216 - (724568 + 6654748) = 5167900 resp. 3784708 + (724568 + 6654748) = 11164024 – Anthon Aug 28 '14 at 8:58
  • @MonoThreaded Those values were for values in my original answer, not the yours that Gilles substituted, and which showed me that the cache information is displayed by top as well. – Anthon Aug 29 '14 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.