My VPS is using much RAM. To identify the problem I stopped literally every service, the VPS is still using 4.5GB of RAM. The VPS is running on XEN, so the RAM is not shared.
This is the output of free -m after stopping all services (except ssh):
[root@node3 ~]# free -m
total used free shared buffers cached
Mem: 6928 5510 1417 0 130 704
-/+ buffers/cache: 4676 2251
Swap: 3071 106 2965
Could someone help me with this? Many thanks.
[root@node3 custombuild]# ps aux | sort -b -k 4 | tail
acusu161 307520 0.0 0.0 94344 1828 ? SN 14:42 0:00 sshd: acusu161@pts/2
root 301805 0.0 0.0 94344 3352 ? SNs 14:19 0:00 sshd: acusu161 [priv]
root 307459 0.0 0.0 94344 3360 ? SNs 14:41 0:00 sshd: acusu161 [priv]
acusu161 301833 0.0 0.0 94484 1896 ? SN 14:19 0:00 sshd: acusu161@pts/1
acusu161 328664 0.0 0.0 95128 1748 ? SN 16:24 0:00 sshd: acusu161@pts/4
root 328660 0.0 0.0 95128 3348 ? SNs 16:24 0:00 sshd: acusu161 [priv]
named 10398 0.0 0.1 589860 7896 ? Ssl Jul23 0:02 named -u named
root 340628 0.0 0.3 127764 26884 ? SNs 16:48 0:01 lfd - sleeping
root 6508 0.0 0.4 38936 32788 ? S<Lsl Jul23 0:00 iscsiuio
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
It's nothing to worry about, linux likes to cache things, the cache will be overwritten when new processes ask for the memory.
You can clear it. ymmv.
source: http://duopetalflower.blogspot.ca/2009/09/clearing-cache-memory-in-linux-using.html
source: http://www.commandlinefu.com/commands/view/1026/empty-the-linux-buffer-cache
source: https://stackoverflow.com/questions/8066252/invalid-argument-error-for-sysctl-vm-drop-caches-key-in-ubuntu-11-10-kernel-3
Try installing an utility such as "htop" and sorting (F6) by memory usage (MEM%) to see which processes are using how much memory.