smem——内存检测工具

 

smem is a tool that can give numerous reports on memory usage on Linux systems. Unlike existing tools, smem can report proportional set size (PSS), which is a more meaningful representation of the amount of memory used by libraries and applications in a virtual memory system.

 

Because large portions of physical memory are typically shared among multiple applications, the standard measure of memory usage known as resident set size (RSS) will significantly overestimate memory usage. PSS instead measures each application's "fair share" of each shared area to give a realistic measure.

 

 


 

smem是一个基于Python的检测Linux系统内存使用情况的工具,smem可以给出每个程序或库的USS、PSS和RSS。

 

USS(unique set size):进程独自占用的内存,不包括共享库占用的内存。这个数值应该最为重要,USS也正是杀死这个进程后可以释放的内存。

PSS(proportiaonal set size):所有使用某共享库的程序均分该共享库占用的内存时,每个进程占用的内存。显然所有进程的PSS之和就是系统的内存使用量。

RSS (resident set size):实际占用的内存,包括独自占用的内存和共享库占用的所有内存。RSS具有一定的误导性,它并不能完全体现出一个进程的内存使用情况,因为共享库所占用的那部分内存的分配和释放很有可能与是否运行这个进程没有关系。

 

 


 

Using smem

Show basic process informationsmem
Show library-oriented viewsmem -m
Show user-oriented viewsmem -u
Show system viewsmem -R 4G -K /path/to/vmlinux -w
Show totals and percentagessmem -t -p
Show different columnssmem -c "name user pss"
Sort by reverse RSSsmem -s rss -r
Show processes filtered by mappingsmem -M libxml
Show mappings filtered by processsmem -m -P [e]volution
Read data from capture tarballsmem --source capture.tar.gz
Show a bar chart labeled by pidsmem --bar pid -c "pss uss"
Show a pie chart of RSS labeled by namesmem --pie name -s rss

 

See also:http://www.selenic.com/smem/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值