How to check memory utilization by a process in Linux
PS service
In Linux, process memory utilization is measured by two values, VSZ and RSS (both measured in bytes).
RSS stands for Resident Set Size and shows how much RAM is utilized at the time the command is output.
It also should be noted that it shows the entire stack of physically allocated memory.
VSZ - Virtual Memory Size. The list of processes sorted by these parameters can be viewed by using the command: For RSS (Resident Set Size):
ps -aux --sort -rss
For VSZ (Virtual Memory Size):
ps -aux --sort -vsz
Depending on the command that has been input, output results will be displayed in the order of priority by the percentage of RAM used by the process (RSS) or the amount of virtual memory (VSZ) used by the process in the descending order.
$ ps -aux --sort -rss
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 30799 51.2 8.1 2733764 285136 ? Rl 09:25 5:30 /usr/lib/chromium-browser/chromium-browser --ppapi-flash-path=/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so --ppap
user 2800 0.1 6.6 9972812 234184 ? Sl окт31 1:26 /usr/bin/plasmashell --shut-up
user 31308 2.4 5.3 1767496 188672 ? Sl 09:26 0:13 /usr/lib/chromium-browser/chromium-browser --type=renderer --enable-pinch --field-trial-handle=7228759356551874141,180166971
user 31011 3.9 5.3 1793296 186812 ? Sl 09:25 0:25 /usr/lib/chromium-browser/chromium-browser --type=renderer --enable-pinch --field-trial-handle=7228759356551874141,180166971
user 31369 5.5 4.8 1378568 171328 ? Sl 09:28 0:23 /usr/lib/libreoffice/program/soffice.bin --writer --splash-pipe=5
user 14442 12.1 4.2 1050808 150148 ? Sl 01:19 60:04 /usr/lib/x86_64-linux-gnu/libexec/kscreenlocker_greet --graceTime 5000 --ksldfd 26
user 31111 0.9 3.8 1708496 134564 ? Sl 09:25 0:06 /usr/lib/chromium-browser/chromium-browser --type=renderer --enable-pinch --field-trial-handle=7228759356551874141,180166971
user 1225 0.0 3.7 3639148 132092 ? Sl окт31 1:00 /usr/bin/plasmashell --shut-up
user 31078 0.6 3.7 1724480 130724 ? Sl 09:25 0:03 /usr/lib/chromium-browser/chromium-browser --type=renderer --enable-pinch --field-trial-handle=7228759356551874141,180166971
user 30986 0.7 3.3 1717860 117660 ? Sl 09:25 0:04 /usr/lib/chromium-browser/chromium-browser --type=renderer --enable-pinch --field-trial-handle=7228759356551874141,180166971
user 1216 1.7 3.2 3271220 113736 ? Sl окт31 20:36 kwin_x11
Important columns are:
- USER The user on whose behalf the process is running
- PID Process ID
- RSS The physical memory used by the process
- VSZ Virtual memory
It follows from the example that most of the memory (RSS) is used by the chromium browser.