From 0f3c654b8aef437c70735f82f7df2cb54fbc692f Mon Sep 17 00:00:00 2001 From: wuxz3 Date: Thu, 29 Dec 2022 14:12:01 +0800 Subject: [PATCH] document install methods --- README.en.md | 77 ++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/README.en.md b/README.en.md index 8b12b56..c4f015e 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,41 @@ -# ps_mem - -#### Description -profiling tool for memory - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +ps_mem +====== +A utility to accurately report the core memory usage for a program + +Yes the name is a bit weird. coremem would be more appropriate, +but for backwards compatible reasons the ps_mem name remains. + +Install: + +`pip install ps_mem` is supported, or rpm and deb packages +are available for most distros. Also the ps_mem.py script +can be run directly. + +Usage: + +``` +ps_mem [-h|--help] [-p PID,...] [-s|--split-args] [-t|--total] [-w N] +``` +Example output: +``` + Private + Shared = RAM used Program + 34.6 MiB + 1.0 MiB = 35.7 MiB gnome-terminal +139.8 MiB + 2.3 MiB = 142.1 MiB firefox +291.8 MiB + 2.5 MiB = 294.3 MiB gnome-shell +272.2 MiB + 43.9 MiB = 316.1 MiB chrome (12) +913.9 MiB + 3.2 MiB = 917.1 MiB thunderbird +--------------------------------- + 1.9 GiB +================================= +``` +The [-p PID,...] option allows filtering the results. +For example to restrict output to the current $USER you could: +``` +sudo ps_mem -p $(pgrep -d, -u $USER) +``` +or to summarize the total RAM usage per user you could: +``` +for i in $(ps -e -o user= | sort | uniq); do + printf '%-20s%10s\n' $i $(sudo ps_mem --total -p $(pgrep -d, -u $i)) +done +``` -- Gitee