0

for the past week my CentOS VPS has had 99% memory usage.

[root@server ~]# free -m
         total       used       free     shared    buffers     cached
Mem:          2048       2032         15          2          0         17
-/+ buffers/cache:       2014         33
Swap:         2048         45       2002

After rebooting the server, the memory will slowly increase over a period of 2 hours when then, again the server is at 99% memory usage.

[root@server ~]# top
top - 13:34:10 up 2 days, 17:30,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  49 total,   1 running,  47 sleeping,   1 stopped,   0 zombie
Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,   349744k used,  1747408k free,        0k buffers
Swap:  2097152k total,        0k used,  2097152k free,    52452k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0 19236 1456 1216 S  0.0  0.1   0:00.06 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd/221
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper/221
  133 root      16  -4 10644  660  396 S  0.0  0.0   0:00.00 udevd
  493 root      20   0  179m 1460 1056 S  0.0  0.1   0:00.02 rsyslogd
  540 root      20   0 66220 1176  464 S  0.0  0.1   0:00.01 sshd
  574 root      20   0 11308 1464 1208 S  0.0  0.1   0:00.00 mysqld_safe
  676 mysql     20   0  432m  20m 5612 S  0.0  1.0   0:00.31 mysqld
  702 root      20   0 19268  756  500 S  0.0  0.0   0:00.00 dovecot
  710 dovecot   20   0 12988 1068  872 S  0.0  0.1   0:00.00 anvil
  711 root      20   0 13116 1188  872 S  0.0  0.1   0:00.00 log
  784 root      20   0 80860 3388 2472 S  0.0  0.2   0:00.01 master
  792 postfix   20   0 80940 3296 2424 S  0.0  0.2   0:00.00 pickup

Any help would be amazing, thank you.

Shift-M Top

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
676 mysql     20   0  432m  20m 5612 S  0.0  1.0   0:00.70 mysqld
795 root      20   0  127m  16m 3740 S  0.0  0.8   0:00.11 cwpsrvd
812 root      20   0  127m  13m  764 S  0.0  0.7   0:00.00 cwpsrvd
811 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
813 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
814 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
815 root      20   0  127m  13m  760 S  0.0  0.7   0:00.00 cwpsrvd
851 root      20   0 99972 4332 3348 S  0.0  0.2   0:00.06 sshd
1226 postfix   20   0 81132 3956 2860 S  0.0  0.2   0:00.00 tlsmgr
3744 root      20   0 98632 3816 2880 S  0.0  0.2   0:00.00 sshd
784 root      20   0 80860 3388 2472 S  0.0  0.2   0:00.01 master
793 postfix   20   0 81008 3356 2472 S  0.0  0.2   0:00.00 qmgr
792 postfix   20   0 80940 3296 2424 S  0.0  0.2   0:00.00 pickup
3805 root      20   0 67564 3264 2504 S  0.0  0.2   0:00.00 sshd
803 root      20   0 56612 2952 1652 S  0.0  0.1   0:00.08 httpd
848 nobody    20   0 56744 2884 1368 S  0.0  0.1   0:00.00 httpd
849 nobody    20   0 56744 2884 1368 S  0.0  0.1   0:00.00 httpd

Shift-M Top (99% Memory usage)

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
676 mysql     20   0  432m 4556 3028 S  0.3  0.2   0:04.20 mysqld
19989 dovecot   20   0 95588 4040 2860 S  0.0  0.2   0:00.01 auth
20717 root      20   0 98632 3808 2884 S  0.0  0.2   0:00.00 sshd
851 root      20   0 99972 3068 2904 S  0.0  0.1   0:00.16 sshd
1226 postfix   20   0 81132 2332 2240 S  0.0  0.1   0:00.00 tlsmgr
784 root      20   0 80860 2192 2100 S  0.0  0.1   0:00.06 master

cat /proc/meminfo

MemTotal:        2097152 kB
MemFree:            3796 kB
Cached:            18472 kB
Buffers:               0 kB
Active:            19628 kB
Inactive:           6712 kB
Active(anon):       3608 kB
Inactive(anon):     4260 kB
Active(file):      16020 kB
Inactive(file):     2452 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097152 kB
SwapFree:        2059452 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:          7868 kB
Shmem:              2708 kB
Slab:            2067000 kB
SReclaimable:    2057576 kB
SUnreclaim:         9424 kB
5
  • Press shift-M while viewing top output, then paste it. Apr 27, 2015 at 4:11
  • 2
    You aren't using much memory right now. Try it again when your memory is full. Apr 27, 2015 at 4:35
  • Having only 33M free (taking into account buffering / caching) would seem to indicate that you are running low on available memory. However, as @MichaelHampton points out, the pasted output from top doesn't match the output of free -m. Apr 27, 2015 at 9:42
  • Based on your "free -m" output, we can rule out the normal Linux pagecache-related memory occupation (this can be seen by the -/+ buffers/cache line, which report 33 MB only as free). However, from your second top I don't see anything wrong at first glace. Can you provide some other top output and also paste here cat /proc/meminfo?
    – shodanshok
    Apr 27, 2015 at 9:46
  • Yes, this is what I don't understand unfortunately. Apr 27, 2015 at 22:27

0

You must log in to answer this question.

Browse other questions tagged .