smem
smem reports memory usage with shared memory divided proportionally among processes, includes swap usageInstallation
When smem is not installed by default, it can be added to the system using the relevant software package.
Package information for smem
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | smem |
|
Arch Linux | smem |
|
Debian | smem |
|
Fedora | smem |
|
Red Hat Enterprise Linux | smem |
|
Rocky Linux | smem |
|
Ubuntu | smem |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Short option | Long option | Description |
---|---|---|
-a | --autosize | Set column width to fit terminal size |
-c | --columns=COLUMNS | Define which columns to show |
-h | --help | Show help |
-k | --abbreviate | Show unit with suffix |
-m | --mappings | Memory usage by mapping |
-n | --numeric | Show user ID instead of username |
-p | --percent | Show percentage |
-r | --reverse | Reverse the sorted data |
-s FIELD | --sort=FIELD | Select field to sort on |
-t | --total | Show totals |
-u | --users | Memory usage by user |
-w | --system | Systemwide memory usage |
-H | --no-header | Do not show the header in output |
-K PATH | --kernel=PATH | Path to uncompressed kernel image (useful for -w) |
-M FILTER | --mapfilter=FILTER | Set mapping filter (regular expression) |
-P FILTER | --processfilter=FILTER | Set process filter (regular expression) |
-R AMOUNT | --realmem=AMOUNT | Define total amount of memory, also relevant for systemwide output (-w) |
-S PATH | --source=PATH | Defines path to /proc. May be useful to investigate captured data from other system |
-U FILTER | --userfilter=FILTER | Set user filter (regular expression) |
--bar=FIELD | Show bar graph for selected field (graphical) | |
--pie=FIELD | Show pie graph for selected field (graphical) |
Missing an option in this overview? Share your feedback.
Examples using smem
Memory and swap usage
Show processes and their memory usage
smem
Swap usage per process ID
Show only specific columns with data of interest
smem --columns="pid swap"
Relevant articles using the smem command
The following articles include an example on how to use smem and might be worth further exploring.