转载:https://mp.weixin.qq.com/s?__biz=MzA4NzQ5MzQ2MA==&mid=2649612694&idx=1&sn=d31b7e3971ad875491e9ffef4998a5f4&scene=0&key=77421cf58af4a653d58d1ec354c34d9727a4560081cfb2983918c11bc2666f1ed8f746488e62defaebfe76cde33b9989&ascene=0&uin=MTQ3MjI3MzYwMA%3D%3D&devicetype=iMac+MacBookPro12%2C1+OSX+OSX+10.11.5+build(15F34)&version=11020201&pass_ticket=hg6k%2FMaa0BWLXcHFbD4MG665wLNC4fBbXO0YT547zy05Bd45Y0iuXyY1%2F2r67UNZ

Terms

  • VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)

  • RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存)

  • PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)

  • USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)

一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS

Overview

The aim of this post is to provide information that will assist in interpreting memory reports from various tools so the true memory usage for Linux processes and the system can be determined.

Android has a tool called procrank (/system/xbin/procrank), which lists out the memory usage of Linux processes in order from highest to lowest usage. The sizes reported per process are VSS, RSS, PSS, and USS.

For the sake of simplicity in this description, memory will be expressed in terms of pages, rather than bytes. Linux systems like ours manage memory in 4096 byte pages at the lowest level.

VSS (reported as VSZ from ps) is the total accessible address space of a process.This size also includes memory that may not be resident in RAM like mallocs that have been allocated but not written to. VSS is of very little use for determing real memory usage of a process.

RSS is the total memory actually held in RAM for a process.RSS can be misleading, because it reports the total all of the shared libraries that the process uses, even though a shared library is only loaded into memory once regardless of how many processes use it. RSS is not an accurate representation of the memory usage for a single process.

PSS differs from RSS in that it reports the proportional size of its shared libraries, i.e. if three processes all use a shared library that has 30 pages, that library will only contribute 10 pages to the PSS that is reported for each of the three processes. PSS is a very useful number because when the PSS for all processes in the system are summed together, that is a good representation for the total memory usage in the system. When a process is killed, the shared libraries that contributed to its PSS will be proportionally distributed to the PSS totals for the remaining processes still using that library. In this way PSS can be slightly misleading, because when a process is killed, PSS does not accurately represent the memory returned to the overall system.

USS is the total private memory for a process, i.e. that memory that is completely unique to that process.USS is an extremely useful number because it indicates the true incremental cost of running a particular process. When a process is killed, the USS is the total memory that is actually returned to the system. USS is the best number to watch when initially suspicious of memory leaksin a process.

For systems that have Python available, there is also a nice tool calledsmem that will report memory statistics including all of these categories.

# procrank
procrank
PID      Vss      Rss      Pss      Uss cmdline
481   31536K   30936K   14337K    9956K system_server
475   26128K   26128K   10046K    5992K zygote
526   25108K   25108K    9225K    5384K android.process.acore
523   22388K   22388K    7166K    3432K com.android.phone
574   21632K   21632K    6109K    2468K com.android.settings
521   20816K   20816K    6050K    2776K jp.co.omronsoft.openwnn
474    3304K    3304K    1097K     624K /system/bin/mediaserver
37     304K     304K     289K     288K /sbin/adbd
29     720K     720K     261K     212K /system/bin/rild
601     412K     412K     225K     216K procrank
   1     204K     204K     185K     184K /init
35     388K     388K     182K     172K /system/bin/qemud
284     384K     384K     160K     148K top
27     376K     376K     148K     136K /system/bin/vold
261     332K     332K     123K     112K logcat
33     396K     396K     105K      80K /system/bin/keystore
32     316K     316K     100K      88K /system/bin/installd
269     328K     328K      95K      72K /system/bin/sh
26     280K     280K      93K      84K /system/bin/servicemanager
45     304K     304K      91K      80K /system/bin/qemu-props
34     324K     324K      91K      68K /system/bin/sh
260     324K     324K      91K      68K /system/bin/sh
600     324K     324K      91K      68K /system/bin/sh
25     308K     308K      88K      68K /system/bin/sh
28     232K     232K      67K      60K /system/bin/debuggerd
#

top  | grep app名称

ps  |  grep app名称

procrank | grep app名称

dumpsys meminfo app名称

前两个命令只能查到VSS RSS内存占用信息

而后面两个命令可以查出  PSS USS内存占用.

dumpsys meminfo 可以查出native和dalvik分别占用多少内存

dumpsys 用来给出手机中所有应用程序的信息,并且也会给出现在手机的状态。

dumpsys [Option]

meminfo 显示内存信息

cpuinfo 显示CPU信息

account 显示accounts信息

activity 显示所有的activities的信息

window 显示键盘,窗口和它们的关系

wifi 显示wifi信息

top 内存耗用:VSS/RSS/PSS/USS相关推荐

  1. 内存:VSS/RSS/PSS/USS区别和监控

    软件开发的最后阶段就是测试,了解软件整体的cpu和mem使用情况,之前一直用ps来确定cpu使用率和rss内存,最近监控python多进程软件时,累积rss竟然超过了节点物理内存126G,原因在此处梳 ...

  2. rss C语言,Android内存:VSS/RSS/PSS/USS介绍

    一般来说内存占用大小有如下规律:VSS>=RSS>=PSS>=USS 1.VSS - Virtual Set Size(用处不大) 虚拟耗用内存(包含共享库占用的全部内存,以及分配但 ...

  3. 内存耗用:VSS/RSS/PSS/USS

    http://hi.baidu.com/donghaozheng/blog/item/235da701ab70f60a1c95832e.html Terms VSS- Virtual Set Size ...

  4. 内存耗用:VSS/RSS/PSS/USS 介绍

    参考:内存耗用:VSS/RSS/PSS/USS 的介绍 - 简书 内存耗用:VSS/RSS/PSS/USS_adaptiver的博客-CSDN博客_rss uss VSS- Virtual Set S ...

  5. 【转】内存耗用:VSS/RSS/PSS/USS

    [转]内存耗用:VSS/RSS/PSS/USS Terms VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理 ...

  6. android 内存uss rss,内存VSS/RSS/PSS/USS名词解释

    VSS(virtual set size)虚拟耗用内存(包含共享库占用的内存) RSS(Resident set size)实际使用物理内存(包含共享库占用的内存) RSS是进程实际驻存在物理内存的部 ...

  7. linux中pss用法,[Linux] Memory: VSS/RSS/PSS/USS

    Terms VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS- Prop ...

  8. linux vss rss区别,关于VSS / RSS / PSS / USS的解释是否准确?

    我阅读了有关VSS / RSS / PSS / USS的说明: 这篇文章的目的是提供信息,以帮助解释来自各种工具的内存报告,以便可以确定Linux进程和系统的实际内存使用情况. Android有一个称 ...

  9. linux 进程的vss rss uss,内核/内存管理中的VSS/RSS/PSS/USS

    转自:http://www.douban.com/note/161471809/ RSS is the total memory actually held in RAM for a process. ...

  10. 内存耗用:VSS/RSS/PSS/USS 的介绍

    https://www.cnblogs.com/jycboy/p/5453533.html VSS:Virtual Set Size,虚拟耗用内存.它是一个进程能访问的所有内存空间地址的大小.这个大小 ...

最新文章

  1. 致新手——OpenStack云倒底是什么?
  2. 吸收塔如何提高吸收率_燕姐强烈推荐的一款燕窝饮,吸收率原来真的可以这么高!...
  3. 13.multi_search_api
  4. 企业级rancher搭建Kubernetes(采用rancher管理平台搭建k8s)
  5. SpringCloud Greenwich(三)注册中心之zookeeper、Zuul和 gateway网关配置
  6. 皮尔洛和c罗讲什么语言,皮尔洛:如果我跟C罗是队友 我可能能成历史助攻王
  7. python中int转换为时间戳_python日期和时间戳互相转化操作详解
  8. 字节跳动最新简单算法面试题
  9. 268. 丢失的数字 Missing Number
  10. MSYS2 安装和配置
  11. 冒泡排序c语言程序,冒泡排序(C语言实现)
  12. linux系统管理考试试题及答案,《Linux系统管理》期末综合试题答案.doc
  13. Django url管理之include
  14. 小数分频器vhdl实现_使用VHDL进行分频器设计(含小数)
  15. [原创]威胁猎人 | 2018年上半年短视频行业黑灰产研究报告
  16. live2d碰撞_Euclidの基本について
  17. ACO蚁群算法(附MATLAB源码)
  18. Vi编辑器的常用命令3(其他操作)
  19. 太阳能路灯网站SEO执行方案
  20. 28 Apr 10:25:21.537 # HandleServiceCommands: system error caught. error code=1072, message = Create

热门文章

  1. 游戏平台搭建免费版教程
  2. 信用卡前6位bin号代表什么
  3. 百度SEO标题关键词伪原创组合工具
  4. matlab6数学建模基础教程,《数学建模基础教程》.pdf
  5. HDFS原理 | NameNode和DataNode工作原理(图形化通俗易懂)
  6. 二叉链表java_二叉树的二叉链表存储及其Java实现
  7. memcached 可视化客户端工具TreeNMS
  8. 用于开启php绘图扩展配置为,女儿墙屋面排水列项应选择()。A.雨水管B.雨水斗C.雨水口D.出水弯管E.檐沟...
  9. Windows环境CMake安装教程
  10. 条码标签打印软件连接不了数据库怎么办?