Top
lastmod 2025-01-02created 2017-06-0214 edits
top - display Linux processes.
VSS vs RSS
In theory, it is said that the exact amount of memory a process occupies cannot be known. However, there are various ways to interpret the number of pages mapped to a process: VSS, RSS, USS, PSS, and so on.
- VSS (Virtual Set Size)
- The size of the virtual memory associated with the process.
- RSS (Resident Set Size)
- The number of physical pages associated with the process.
- Use this one to calculate memory usage.
USS and PSS
Somewhat more meaningful figures than VSS or RSS are USS and PSS, which can be obtained with the procrank command.
- USS (Unique Set Size): The number of pages unique to the process. It is the size of memory private to the process that is not shared.
- PSS (Proportional Set Size): USS + (shared pages / number of sharing processes). That is, the process's own memory usage + the share of shared memory taken up by one process. If process A uses 6MB of memory and 2MB of it is the process's own region, the remaining 4MB is shared memory. If the 4MB of shared memory is shared by 4 processes, the PSS is 2MB + (4MB/4) = 3MB.
PSS divides shared pages by the number of sharing processes, giving a more accurate picture of memory usage. It can be seen as the value closest to the actual amount of memory a process uses.
Fields Management
Press f to select the displayed fields.
Fields Management for window 1:Def, whose current sort field is %CPU
Navigate with Up/Dn, Right selects for move then <Enter> or Left commits,
'd' or <Space> toggles display, 's' sets sort. Use 'q' or <Esc> to end!
- PID - Process Id
- USER - Effective User Name
- PR - Priority
- NI - Nice Value
- VIRT - Virtual Image (KiB)
- RES - Resident Size (KiB)
- SHR - Shared Memory (KiB)
- S - Process Status
- %CPU - CPU Usage
- %MEM - Memory Usage (RES)
- TIME+ - CPU Time, hundredths
- COMMAND - Command Name/Line
- PPID - Parent Process pid
- UID - Effective User Id
- RUID - Real User Id
- RUSER - Real User Name
- SUID - Saved User Id
- SUSER - Saved User Name
- GID - Group Id
- GROUP - Group Name
- PGRP - Process Group Id
- TTY - Controlling Tty
- TPGID - Tty Process Grp Id
- SID - Session Id
- nTH - Number of Threads
- P - Last Used Cpu (SMP)
- TIME - CPU Time
- SWAP - Swapped Size (KiB)
- CODE - Code Size (KiB)
- DATA - Data+Stack (KiB)
- nMaj - Major Page Faults
- nMin - Minor Page Faults
- nDRT - Dirty Pages Count
- WCHAN - Sleeping in Function
- Flags - Task Flags
- CGROUPS - Control Groups
- SUPGIDS - Supp Groups IDs
- SUPGRPS - Supp Groups Names
- TGID - Thread Group Id
- OOMa - OOMEM Adjustment
- OOMs - OOMEM Score current
- ENVIRON - Environment vars
- vMj - Major Faults delta
- vMn - Minor Faults delta
- USED - Res+Swap Size (KiB)
- nsIPC - IPC namespace Inode
- nsMNT - MNT namespace Inode
- nsNET - NET namespace Inode
- nsPID - PID namespace Inode
- nsUSER - USER namespace Inode
- nsUTS - UTS namespace Inode
- LXC - LXC container name
- RSan - RES Anonymous (KiB)
- RSfd - RES File-based (KiB)
- RSlk - RES Locked (KiB)
- RSsh - RES Shared (KiB)
- CGNAME - Control Group name
- NU - Last Used NUMA node
See also
- ps
- VSS
- RSS
- USS
- PSS
- htop
- ctop
- gtop
- glances
- nmon
- free
- Resource usage
- eDEX-UI
- bashtop
- LXTask - (LXDE; lightweight task manager]])
- Sampler - Tool for running shell commands, visualization, and alerting