SMEM(8)
๐ SMEM(8) โ smem, the memory tea spiller ๐
okay so bestie, welcome to smem(8) โ the page for smem, the tool that reports memory usage with shared memory divided proportionally. Itโs giving โwho is using the RAM and how do we split the shared bits fairlyโ energy, and honestly? Iconic.
โจ NAME โจ
smem โ Report memory usage with shared memory divided proportionally.
๐ธ SYNOPSIS ๐ธ
smem [options]
๐ฆ DESCRIPTION ๐ฆ
smem reports physical memory usage, taking shared memory pages into account. Unshared memory is reported as the USS (Unique Set Size). Shared memory is divided evenly among the processes sharing that memory. The unshared memory (USS) plus a process's proportion of shared memory is reported as the PSS (Proportional Set Size). The USS and PSS only include physical memory usage. They do not include memory that has been swapped out to disk.
Memory can be reported by process, by user, by mapping, or systemwide. Both text mode and graphical output are available. Versatility queen. ๐
๐ OPTIONS ๐
๐ GENERAL OPTIONS ๐
-h,--helpโ Show help. Cute and simple, no notes. โจ
๐ SOURCE DATA ๐
By default, smem will pull most of the data it needs from the /proc filesystem of the system it is running on. The --source option lets you used a tarred set of /proc data saved earlier, possibly on a different machine. The --kernel and --realmem options let you specify a couple things that smem cannot discover on its own.
-K KERNEL,--kernel=KERNELโ Path to an uncompressed kernel image. This letssmeminclude the size of the kernel's code and statically allocated data in the systemwide (-w) output. (To obtain an uncompressed image of a kernel on disk, you may need to build the kernel yourself, then locate filevmlinuxin the source tree.)-R REALMEM,--realmem=REALMEMโ Amount of physical RAM. This letssmemdetect the amount of memory used by firmware/hardware in the systemwide (-w) output. If provided, it will also be used as the total memory size to base percentages on. Example:--realmem=1024M-S SOURCE,--source=SOURCEโ/procdata source. This lets you specify an alternate source of the/procdata. For example, you can capture data from an embedded system usingsmemcap, and parse the data later on a different machine. If the--sourceoption is not included,smemreports memory usage on the running system.
๐ REPORT BY ๐
If none of the following options are included, smem reports memory usage by process.
-m,--mappingsโ Report memory usage by mapping. ๐บ๏ธ-u,--usersโ Report memory usage by user. ๐ซถ-w,--systemโ Report systemwide memory usage summary. ๐
๐ FILTER BY ๐
If none of these options are included, memory usage is reported for all processes, users, or mappings. (Note: If you are running as a non-root user, and if you are not using the --source options, then you will only see data from processes whose /proc/ information you have access to.)
-M MAPFILTER,--mapfilter=MAPFILTERโ Mapping filter regular expression. ๐-P PROCESSFILTER,--processfilter=PROCESSFILTERโ Process filter regular expression. ๐ง-U USERFILTER,--userfilter=USERFILTERโ User filter regular expression. ๐
โญ OUTPUT FORMATTING โญ
-a,--autosizeโ Size columns to fit terminal size. ๐-c COLUMNS,--columns=COLUMNSโ Columns to show. ๐๏ธ-H,--no-headerโ Disable header line. ๐-k,--abbreviateโ Show unit suffixes. ๐ท๏ธ-n,--numericโ Show numeric user IDs instead of usernames. ๐ข-p,--percentโ Show percentages. ๐ฏ-r,--reverseโ Reverse sort. ๐-s SORT,--sort=SORTโ Field to sort on. ๐งฎ-t,--totalsโ Show totals. โ
๐ OUTPUT TYPE ๐
These options specify graphical output styles. Chart girlies, rise. ๐
--bar=BARโ Show bar graph. ๐--pie=PIEโ Show pie graph. ๐ฅง
๐ง REQUIREMENTS ๐ง
smem requires:
- Linux kernel providing
'Pss'metric in/proc/<pid>/smaps(generally2.6.27or newer). ๐ง Python 2.x(at least2.4or so). ๐- The
matplotliblibrary (only if you want to generate graphical charts). ๐
๐ซถ EMBEDDED USAGE ๐ซถ
To capture memory statistics on resource-constrained systems, the smem source includes a utility named smemcap. smemcap captures all /proc entries required by smem and outputs them as an uncompressed .tar file to STDOUT. smem can analyze the output using the --source option. smemcap is small and does not require Python. Low-key genius behavior. ๐ง
To use smemcap:
- Obtain the
smemsource athttp://selenic.com/repo/smem - Compile
smemcap.cfor your target system. - Run
smemcapon the target system and save the output:
smemcap > memorycapture.tar
- Copy the output to another machine and run
smemon it:
smem -S memorycapture.tar
๐ FILES ๐
/proc/$pid/cmdline/proc/$pid/smaps/proc/$pid/stat/proc/meminfo/proc/version
๐ RESOURCES ๐
- Main Web Site:
http://www.selenic.com/smem - Source code repository:
http://selenic.com/repo/smem - Mailing list:
http://selenic.com/mailman/listinfo/smem
๐ SEE ALSO ๐
free(1), pmap(1), proc(5), ps(1), top(1), vmstat(8)
๐ COPYING ๐
Copyright (C) 2008-2009 Matt Mackall. Free use of this software is granted under the terms of the GNU General Public License version 2 or later.
๐ AUTHOR ๐
smem was written by Matt Mackall.
mwah ๐ โ thatโs the whole vibe, bestie: SMEM(8), dated 03/15/2010, and yes, she ate. ๐
๐
๐ฆ where this page comes from
- epel 10: smem 1.5-20.el10_3 ยท GPL-2.0-or-later
- epel 9: smem 1.5-11.el9 ยท GPLv2+
- fedora 43: smem 1.5-18.fc43 ยท GPL-2.0-or-later
- fedora 44: smem 1.5-19.fc44 ยท GPL-2.0-or-later
- nixos 26.05: smem 1.5
- nixpkgs unstable: smem 1.5
- opensuse-leap 16.0: smem 1.5-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: smem 1.5-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: smem 1.5-bp160.1.12 ยท GPL-2.0-or-later
- opensuse-leap 16.0: smem 1.5-bp160.1.12 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms