Introduction
In some cases, you might want to check what's currently using up your servers memory. This can be done with the "top" command and the "ps" command.
Procedure
Using the top command:
[root@centos7 centos]# top -o %MEM
top - 04:07:49 up 8 days, 6:31, 1 user, load average: 0.17, 0.11, 0.09
Tasks: 134 total, 1 running, 131 sleeping, 0 stopped, 2 zombie
%Cpu(s): 0.6 us, 1.0 sy, 0.0 ni, 98.2 id, 0.1 wa, 0.0 hi, 0.1 si, 0.0 st
KiB Mem : 3078756 total, 187172 free, 630524 used, 2261060 buff/cache
KiB Swap: 1048572 total, 1025172 free, 23400 used. 2103924 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12896 root 20 0 251484 130944 5516 S 0.0 4.3 0:35.29 spamd
12970 root 20 0 252676 128404 1820 S 0.0 4.2 0:03.12 spamd child
22739 root 20 0 251484 126836 1444 S 0.0 4.1 0:00.48 spamd child
11913 mysql 20 0 1036956 82656 8568 S 0.3 2.7 6:35.28 mysqld
1298 root 20 0 119228 27492 7060 S 0.0 0.9 4:37.88 cpsrvd (SSL) -
2070 root 20 0 80128 14912 3792 S 0.0 0.5 0:32.66 tailwatchd
16308 root 20 0 53524 12296 2428 S 0.0 0.4 0:00.41 leechprotect
2689 root 20 0 47252 11848 11544 S 1.0 0.4 58:07.68 systemd-journal
2611 root 20 0 332908 11260 9668 S 0.0 0.4 18:14.66 rsyslogd
1730 root 20 0 46384 10780 3056 S 0.0 0.4 0:47.08 queueprocd - wa
2204 root 20 0 227632 10020 6124 S 0.0 0.3 0:29.37 httpd
2841 polkitd 20 0 610528 9120 2704 S 0.0 0.3 0:10.60 polkitd
11500 mailnull 20 0 80584 8688 4268 S 0.0 0.3 0:03.03 exim
16309 nobody 20 0 229664 6876 1864 S 0.0 0.2 0:00.39 httpd
16310 nobody 20 0 229664 6872 1860 S 0.0 0.2 0:00.40 httpd
16311 nobody 20 0 229664 6872 1860 S 0.0 0.2 0:00.37 httpd
16312 nobody 20 0 229664 6872 1860 S 0.0 0.2 0:00.36 httpd
16313 nobody 20 0 229664 6872 1860 S 0.0 0.2 0:00.38 httpd
21855 nobody 20 0 229664 6872 1860 S 0.0 0.2 0:00.30 httpd
13239 cpanel 20 0 61304 5772 4248 S 0.0 0.2 0:00.02 lmtp
Using the ps command:
[root@centos7 centos]# ps aux --sort=-%mem | head
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 12896 0.0 4.2 251484 130944 ? Ss Feb08 0:35 /usr/local/cpanel/3rdparty/perl/530/bin/perl -T -w /usr/local/cpanel/3rdparty/bin/spamd --allowed-ips=127.0.0.1,::1 --max-children=5 --pidfile=/var/run/spamd.pid --listen=5 --listen=6
root 12970 0.0 4.1 252676 128404 ? S 01:35 0:03 spamd child
root 22739 0.0 4.1 251484 126836 ? S Feb08 0:00 spamd child
mysql 11913 0.1 2.6 1036956 82656 ? Sl Feb05 6:35 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
root 1298 0.0 0.8 119228 27492 ? S Jan31 4:37 cpsrvd (SSL) - waiting for connections
root 2070 0.0 0.4 80128 14912 ? S Jan31 0:32 tailwatchd
root 16308 0.0 0.3 53524 12296 ? S Feb08 0:00 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/leechprotect
root 2689 1.0 0.3 47252 11904 ? Ss Feb05 58:07 /usr/lib/systemd/systemd-journald
root 2611 0.3 0.3 332908 11300 ? Ssl Feb05 18:14 /usr/sbin/rsyslogd -n
[root@centos7 centos]#
Comments
0 comments
Article is closed for comments.