diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-09 13:29:19 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-02-09 13:29:19 +0100 |
commit | d66566524b192b6b037e1744b26f769d29f49928 (patch) | |
tree | 0de42affa70a3d7c6b47e09ee6ad4fc58cac67e4 | |
parent | f0211e90a9c52e61fca2a197a894642f2dff74e7 (diff) | |
download | psutil-d66566524b192b6b037e1744b26f769d29f49928.tar.gz |
enhance doc
-rw-r--r-- | docs/index.rst | 5 | ||||
-rwxr-xr-x | scripts/procsmem.py | 22 |
2 files changed, 25 insertions, 2 deletions
diff --git a/docs/index.rst b/docs/index.rst index 719aacc3..dc0c5624 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1083,10 +1083,13 @@ Process class .. note:: `uss` is probably the most representative metric for determining how - much memory is being used by a process. + much memory is actually being used by a process. It represents the amount of memory that would be freed if the process was terminated right now. + .. note:: see also `scripts/procsmem.py <https://github.com/giampaolo/psutil/blob/master/scripts/procsmem.py>`__ + for an example application. + Example on Linux: >>> import psutil diff --git a/scripts/procsmem.py b/scripts/procsmem.py index bc2a79a2..9b10a6f1 100755 --- a/scripts/procsmem.py +++ b/scripts/procsmem.py @@ -9,10 +9,30 @@ Show detailed memory usage about all (querable) processes. Processes are sorted by their "USS" (Unique Set Size) memory, which is probably the most representative metric for determining how much memory -is being used by a process. +is actually being used by a process. This is similar to "smem" cmdline utility on Linux: https://www.selenic.com/smem/ + +Author: Giampaolo Rodola' <g.rodola@gmail.com> + +~/svn/psutil$ ./scripts/procsmem.py +PID User Cmdline USS PSS Swap RSS +============================================================================== +... +3986 giampao /usr/bin/python3 /usr/bin/indi 15.3M 16.6M 0B 25.6M +3906 giampao /usr/lib/ibus/ibus-ui-gtk3 17.6M 18.1M 0B 26.7M +3991 giampao python /usr/bin/hp-systray -x 19.0M 23.3M 0B 40.7M +3830 giampao /usr/bin/ibus-daemon --daemoni 19.0M 19.0M 0B 21.4M +20529 giampao /opt/sublime_text/plugin_host 19.9M 20.1M 0B 22.0M +3990 giampao nautilus -n 20.6M 29.9M 0B 50.2M +3898 giampao /usr/lib/unity/unity-panel-ser 27.1M 27.9M 0B 37.7M +4176 giampao /usr/lib/evolution/evolution-c 35.7M 36.2M 0B 41.5M +20712 giampao /usr/bin/python -B /home/giamp 45.6M 45.9M 0B 49.4M +3880 giampao /usr/lib/x86_64-linux-gnu/hud/ 51.6M 52.7M 0B 61.3M +20513 giampao /opt/sublime_text/sublime_text 65.8M 73.0M 0B 87.9M +3976 giampao compiz 115.0M 117.0M 0B 130.9M +32486 giampao skype 145.1M 147.5M 0B 149.6M """ from __future__ import print_function |