smem
smem reports memory usage with shared memory divided proportionally among processes, includes swap usage
Typical usage: diagnosing performance issues, monitor memory usage, troubleshootingInstallation
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
Long option | Short option | Description |
---|---|---|
--autosize | -a | Set column width to fit terminal size |
--columns=COLUMNS | -c | Define which columns to show |
--help | -h | Show help |
--abbreviate | -k | Show unit with suffix |
--mappings | -m | Memory usage by mapping |
--numeric | -n | Show user ID instead of username |
--percent | -p | Show percentage |
--reverse | -r | Reverse the sorted data |
--sort=FIELD | -s FIELD | Select field to sort on |
--total | -t | Show totals |
--users | -u | Memory usage by user |
--system | -w | Systemwide memory usage |
--no-header | -H | Do not show the header in output |
--kernel=PATH | -K PATH | Path to uncompressed kernel image (useful for -w) |
--mapfilter=FILTER | -M FILTER | Set mapping filter (regular expression) |
--processfilter=FILTER | -P FILTER | Set process filter (regular expression) |
--realmem=AMOUNT | -R AMOUNT | Define total amount of memory, also relevant for systemwide output (-w) |
--source=PATH | -S PATH | Defines path to /proc. May be useful to investigate captured data from other system |
--userfilter=FILTER | -U 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"
Frequently Asked Questions
What is the smem command and its purpose?
The command smem can help showing memory usage, including the usage of swap. Here are the most common options explained.
Which package provides the smem command?
The command smem is provided by the smem package.
Relevant articles using the smem command
The following articles include an example on how to use smem and might be worth further exploring.
Related and similar commands
Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to smem:
Command | Category | Summary |
---|---|---|
basename | files | Strips directory and file name suffix from a given path |
blkid | storage | Shows block device information |
dmidecode | hardware | Shows hardware information |
numactl | processes | Controls NUMA policy for processes and shared memory |
pidstat | monitoring | Monitoring CPU, memory, and disk activity |
pmap | processes | Shows memory mapping of process |
prtstat | processes | Shows process details for selected process like state, CPU and memory usage |
pwdx | processes | Shows current working directory of a process |
slabtop | memory | Shows slab usage of kernel |
vmstat | memory | Shows virtual memory information, disk IO, CPU activity |
Also 💙 the command-line or terminal? Here is a set of cheat sheets for Linux to get more done from within the shell: