3

By default, top will show, for each process, the fraction of physical memory used by that process:

top - 12:39:34 up 87 days, 18:25,  3 users,  load average: 4.73, 4.89, 4.23
Tasks: 255 total,   2 running, 242 sleeping,   0 stopped,  11 zombie
%Cpu(s): 38.2 us, 37.2 sy,  0.0 ni,  2.8 id, 13.4 wa,  0.0 hi,  8.4 si,  0.0 st
MiB Mem :   3916.2 total,    132.1 free,   3659.9 used,    124.2 buff/cache
MiB Swap:   4096.0 total,   2127.0 free,   1969.0 used.     78.2 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND   
28095 michi     20   0 4428340   2.5g   4604 S 109.5  66.5   2555:15 rslsync   
  425 root       1 -19       0      0      0 D  14.4   0.0 851:42.04 z_wr_iss  
  143 root      20   0       0      0      0 D   3.9   0.0 114:08.83 usb-stora+
  418 root       0 -20       0      0      0 S   3.3   0.0 541:53.24 z_rd_int  
  421 root       0 -20       0      0      0 S   3.3   0.0 541:54.99 z_rd_int  
  422 root       0 -20       0      0      0 S   3.3   0.0 541:49.18 z_rd_int  

How can I instead show the absolute amount of memory used by each process in that column (i.e. MEM% * <total physical memory>)? E.g.:

[...]
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND   
28095 michi     20   0 4428340   2.5g   4604 S 109.5  3.1g   2555:15 rslsync   
  425 root       1 -19       0      0      0 D  14.4    4k 851:42.04 z_wr_iss  
[...]

1 Answer 1

5

The amount of RAM consumed by each process is indicated in the 'RES' (Resident Memory Size) column. To quote the man page:

A subset of the virtual address space (VIRT) representing the non-swapped physical memory a task is currently using.

Taking the 'rslsync' process as an example, 66.5% of the total memory (3916.2 MiB) is 2604.3 MiB, which is 2.5 GiB. This is the value in the RES column.

1
  • I've been using top on Linux for 13 years and I have nothing to add! Thanks for the answer! Aug 20, 2021 at 7:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .