0

My Ubuntu 12.04.2 server (all packages and distribution completely up to date) was just using 558MB of RAM when I shelled in this morning. Nothing is running on the server besides sshd and whatever comes with the distribution. There was only 1 "break-in attempt" from China in /var/log/auth.log (so nothing wildly out of the ordinary there). Every port besides 22 is sealed off from outside from inbound traffic, by iptables.

Is it quite normal for an Ubuntu 12.04.2 server to be using +500MB of RAM after running for only 3 days, or should I be concerned? In case you're wondering, I don't have process info, because I didn't think much of it at first, so I rebooted :(

Memory usage 30 minutes after rebooting (appears normal still):

$free -m
             total       used       free     shared    buffers     cached
Mem:          1995        128       1867          0          5         50
-/+ buffers/cache:         72       1923
Swap:         1953          0       1953
orokusaki
  • 2,693
  • 4
  • 28
  • 42
  • Just so we know that you're looking at the right numbers, can you add the full output of `free`? – Flup Jun 05 '13 at 15:00
  • @Flup - I just added it (replacing my prior note about after-reboot memory usage). The `used` therein was `558` prior to the reboot, and the `free` subsequently being `1437`. What I don't know is what the `buffers/cache` values were before. – orokusaki Jun 05 '13 at 15:04
  • Are you definitely looking at the `-/+ buffers/cache` figures? This is what the server is really using; the rest is used to buffer/cache I/O and can be reclaimed by the kernel when required (subject to the `swappiness` setting). – Flup Jun 05 '13 at 15:04
  • @Flup - you mean, the `72` in my posted output is the memory that is currently actually in use, and the `128` is not? – orokusaki Jun 05 '13 at 15:05
  • It's used memory in the sense you're thinking about. Over time, the kernel uses spare memory to cache data from disk I/O. If there's memory pressure, this space can be reclaimed. The `72` is the amount of memory that is *really* being used by running processes, and the `1923` is the notional amount of memory available if all buffers and cache were purged. – Flup Jun 05 '13 at 15:07
  • @Flup - ah, thanks so much. Would you mind putting something akin to that in an answer, so that I can accept it? – orokusaki Jun 05 '13 at 15:09

1 Answers1

2

You need to look at the -/+ buffers/cache figures. This is what the server is really using; the rest is used to buffer/cache I/O and can be reclaimed by the kernel when required (subject to the swappiness setting).

Over time, the kernel uses spare memory to cache data from disk I/O. If there's memory pressure, this space can be reclaimed. The 72 is the amount of memory that is really being used by running processes, and the 1923 is the notional amount of memory available if all buffers and cache were purged.

Flup
  • 7,688
  • 1
  • 31
  • 43
  • Thanks so much. I cannot believe all this time that I've been looking at the wrong value in that output. – orokusaki Jun 05 '13 at 15:24