SMEM(8) | SMEM(8) |
smem - Report memory usage with shared memory divided proportionally.
smem [options]
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.
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.
If none of the following options are included, smem reports memory usage by process.
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.)
These options specify graphical output styles.
smem requires:
To capture memory statistics on resource-constrained systems, the the smemcap package 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.
To use smemcap:
/proc/$pid/cmdline
/proc/$pid/smaps
/proc/$pid/stat
/proc/meminfo
/proc/version
Main Web Site: http://www.selenic.com/smem
Source code repository: http://selenic.com/repo/smem
Mailing list: http://selenic.com/mailman/listinfo/smem
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.
smem was written by Matt Mackall.
03/15/2010 |