SMEM(8) SMEM(8)

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.

OPTIONS
GENERAL OPTIONS
-h, --help
Show help.

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 lets smem include 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 file vmlinux in the source tree.)

-R REALMEM, --realmem=REALMEM
Amount of physical RAM. This lets smem detect 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
/proc data source. This lets you specify an alternate source of the /proc data. For example, you can capture data from an embedded system using smemcap, and parse the data later on a dif‐
ferent machine. If the --source option is not included, smem reports 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
-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.

--bar=BAR
Show bar graph.

--pie=PIE
Show pie graph.

REQUIREMENTS
smem requires:

· Linux kernel providing 'Pss' metric in /proc/<pid>/smaps (generally 2.6.27 or newer).

· Python 2.x (at least 2.4 or so).

· The matplotlib library (only if you want to generate graphical charts).

EMBEDDED USAGE
To capture memory statistics on resource-constrained systems, the 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.

To use smemcap:

1. Obtain the smem source at http://selenic.com/repo/smem

2. Compile smemcap.c for your target system.

3. Run smemcap on the target system and save the output:
smemcap > memorycapture.tar

4. Copy the output to another machine and run smem on 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.

03/15/2010 SMEM(8)

linux smem 查看各进程使用memory情况的更多相关文章

  1. Linux下查看某个进程打开的文件数-losf工具常用参数介绍

    Linux下查看某个进程打开的文件数-losf工具常用参数介绍 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在linux操作系统中,一切皆文件.通过文件不仅仅可以访问常规数据,还 ...

  2. linux下查看当前进程以及杀死进程

    ###linux下查看当前进程以及杀死进程 查看进程 ps命令查找与进程相关的PID号: ps a :显示现行终端机下的所有程序,包括其他用户的程序. ps -A :显示所有程序. ps c :列出程 ...

  3. Linux下查看某个进程的网络带宽占用情况

    说明: 1.可能查看某个进程的带宽占用需要明确知道PID.进程名字.发送速度.接收速度. 2.很遗憾,在Linux原生的软件中没有这样的一款,只能额外装,最符合以上的情况就只有nethogs. 3.n ...

  4. [转] linux 下查看一个进程运行路径的方法

    http://blog.csdn.net/brioxu/article/details/5104736 在linux下查看进程大家都会想到用 ps -ef|grep XXX ps -aux | hea ...

  5. linux下查看哪个进程占用内存多

    1.用top命令 1.top top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器 可以直接使用top命令后,查看%MEM的内容.可以 ...

  6. Linux下查看哪些进程占用的CPU、内存资源

    1.CPU占用最多的前10个进程: ps auxw|head -1;ps auxw|sort -rn -k3|head -10 2.内存消耗最多的前10个进程 ps auxw|head -1;ps a ...

  7. linux 下查看java进程

    linux下查看出问题的java进程,便于发现程序问题.命令如下: 找到存在问题的java进程号,ps -ef|grep java ,如进程30021 卡住,需要查看该进程信息,那么敲入命令: jst ...

  8. linux下查看运行进程详细信息

    通过ps及top命令查看进程信息时,只能查到相对路径,查不到的进程的详细信息,如绝对路径等.这时,我们需要通过以下的方法来查看进程的详细信息: Linux在启动一个进程时,系统会在/proc下创建一个 ...

  9. linux 下查看一个进程执行路径

    在linux下查看进程大家都会想到用 ps -ef|grep XXX 但是看到的不是全路径.怎么看全路径呢? 每一个进程启动之后在 /proc以下有一个于pid相应的路径 比如:ps -ef|grep ...

随机推荐

  1. 关于offsetTop的误解

    一直以为offset是子元素相对于父元素的距离,后来用了才知道是一个坑,只存在于定位元素中 在做li的搜索的定位的时候,为了得到li相对于ul的距离,本来也可以用li的高度相乘,但是用了offsetT ...

  2. 解释mysql 语句 ——解释CREATE DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

    在我们创建mysql数据库的时候我们经常会用到这句SQL:CREATE DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ ...

  3. 5-niginx-健康检查模块

    1,  nginx有一个自带的健康检查模块, 过于丑陋... 只需要在 nginx.conf下的http中的server配置如下即可 location /basic_status { stub_sta ...

  4. Spring的@Scheduled任务调度

    一. 定时任务实现方式 定时任务实现方式: Java自带的java.util.Timer类,这个类允许你调度一个java.util.TimerTask任务.使用这种方式可以让你的程序按照某一个频度执行 ...

  5. 程序员为什么要写if else,为什么要和别人不一样

    程序员为什么要写if else,为什么要和别人不一样 前言 无聊,睡不着!本文只是随便写写而已!感叹一下程序员的生活! 刚看到一个八级程序员的分级,所以就写了这个随笔,分级如下:        第八级 ...

  6. ASP.NET 之 MVC框架及搭建

    一.MVC简介 MVC:Model-View-Controller(模型-视图-控制器),MVC是一种软件开发架构模式. 1.模型(Model) 模型对象是实现应用程序数据域逻辑的应用程序部件. 通常 ...

  7. Abp中SwaggerUI的接口文档添加上传文件参数类型

    在使用Swashbuckle上传文件的时候,在接口文档中希望看到上传控件,但是C#中,没有FromBodyAttribute这个特性,所以需要在运行时,修改参数的swagger属性.   首先看下,最 ...

  8. 如何移动 nuget 缓存文件夹

    本文告诉大家如何移动 nuget 缓存文件夹. 因为 nuget 文件夹一般比较大,现在我的 nuget 文件夹有 10 G,默认的 nuget 文件夹是在C盘,所以需要移动他. 可以使用下面的代码查 ...

  9. Java数据类型和不同数据类型在JVM内存分配

    1.java数据类型分类 Java语言是强类型(Strongly typed)语言,强类型包含两方面的含义:①所有的变量必须先声明,后使用:②指定类型的变量只能接受类型与之匹配的值.这意味着每个变量和 ...

  10. K:有限状态自动机

      有限状态自动机是一种特殊的状态机.它表示有限个状态以及在这些状态之间的转移和动作等行为的数学模型.有限状态自动机分为两种,一种是 确定有限状态自动机(DFA) ,一种是 非确定有限状态自动机(NF ...