- 浏览: 1501937 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (419)
- XMPP (19)
- Android (180)
- Java (59)
- Network (4)
- HTML5 (13)
- Eclipse (9)
- SCM (23)
- C/C++ (4)
- UML (4)
- Libjingle (15)
- Tools&Softwares (29)
- Linphone (5)
- Linux&UNIX (6)
- Windows (18)
- Google (10)
- MISC (3)
- SIP (6)
- SQLite (5)
- Security (4)
- Opensource (29)
- Online (2)
- 文章 (3)
- MemoryLeak (10)
- Decompile (5)
- Ruby (1)
- Image (1)
- Bat (4)
- TTS&ASR (28)
- Multimedia (1)
- iOS (20)
- Asciiflow - ASCII Flow Diagram Tool.htm (1)
- Networking (1)
- DLNA&UPnP (2)
- Chrome (2)
- CI (1)
- SmartHome (0)
- CloudComputing (1)
- NodeJS (3)
- MachineLearning (2)
最新评论
-
bzhao:
点赞123!
Windows的adb shell中使用vi不乱码方法及AdbPutty -
wahahachuang8:
我觉得这种东西自己开发太麻烦了,就别自己捣鼓了,找个第三方,方 ...
HTML5 WebSocket 技术介绍 -
obehavior:
view.setOnTouchListenerview是什么
[转]android 一直在最前面的浮动窗口效果 -
wutenghua:
[转]android 一直在最前面的浮动窗口效果 -
zee3.lin:
Sorry~~
When I build "call ...
Step by Step about How to Build libjingle 0.4
Running "adb shell procrank
":
root@android:/ # procrank PID Vss Rss Pss Uss cmdline 291 119848K 102340K 59883K 44488K system_server 367 69460K 69020K 42641K 40928K com.android.launcher 2884 72216K 71844K 39865K 27524K system_server 1522 49812K 49676K 23367K 21980K com.android.settings 2536 47792K 47640K 21599K 20444K com.sec.android.app.music
VSS | Virtual Set Size: how much virtual memory associated with process |
RSS | Resident Set Size: how much physical pages allocated for the process. Pages shared between processes are counted multiple times |
PSS | Proportional Set Size. Take the RSS number but evenly distribute shared pages among the sharing processes. For example, if three processes are sharing 3MB, each process gets 1MB in PSS. |
USS | Also known as Private Dirty, which is basically the amount of RAM inside the process that can not be paged to disk (it is not backed by the same data on disk), and is not shared with any other processes. |
Reference: How to discover memory usage of my application in Android
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 leaks in a process.
For systems that have Python available, there is also a nice tool called smem 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
#
发表评论
-
JAAS authentication in Tomcat example
2018-11-19 20:32 593... -
druid 数据库密码加密
2015-03-12 17:43 1388cmd命令:1、切换的druid-0.2.9.jar包所在目 ... -
[Android] 为Android安装BusyBox —— 完整的bash shell
2013-12-27 10:19 1482http://www.cnblogs.com/xiaowen ... -
Windows的adb shell中使用vi不乱码方法及AdbPutty
2013-12-27 10:17 7546http://www.veryhuo.com/down/ht ... -
AppMobi推出新XDK,可创建测试PhoneGap项目
2012-09-03 13:39 2627AppMobi今天发布了一个新的工具PhoneGap Mobi ... -
Sencha
2012-09-03 12:59 1182http://www.sencha.com/ Se ... -
jQuery Mobile学习
2012-09-01 12:33 1683使用Jquery Mobile设计Android通讯录 ... -
BackBone
2012-09-01 12:34 1256Backbone.js 是一种重量级javascript M ... -
jQTouch
2012-08-30 15:57 981A Zepto/jQuery plugin for mobil ... -
SwiFTP
2012-08-30 15:43 1298SwiFTP is a FTP server that run ... -
kWS
2012-08-30 15:41 1195kWS is a lightweight and fast W ... -
jQuery Mobile
2012-08-30 15:07 1021http://jquerymobile.com/ -
PhoneGap
2012-08-30 15:07 1040http://phonegap.com/ -
Android Button background image pressed/highlighted and disabled states without
2012-08-06 12:49 1673http://shikii.net/blog/android- ... -
[AndriodTips]Image, saved to sdcard, doesn't appear in Android's Gallery app
2012-08-04 16:15 1154http://stackoverflow.com/questi ... -
Voice detection for Android
2012-07-23 11:39 2341Here it is, my fist JAVA applic ... -
[AndroidTip]local reference table overflow (max=512)的错误解决
2012-07-22 22:56 6036JNI层coding经常会遇到ReferenceTable o ... -
[AndroidTip]EditText如何初始状态不获得焦点?
2012-07-22 15:35 1222最简单的办法是在EditText前面放置一个看不到的Linea ... -
[AndroidTip]android textview滚动条
2012-07-21 14:29 1293本来是想做一个显示文字信息的,当文字很多时View的高度不能超 ... -
Google公布Android 4.1完整功能
2012-07-16 09:48 3178http://www.android.com/about/je ...
相关推荐
Android平台工具是Android SDK不可或缺的一部分,它包含了开发者在构建、调试和发布Android应用程序时所需的各种命令行工具。这些工具在Android开发过程中起着至关重要的作用,不仅能够帮助开发者高效地管理项目,还...
4. **PROCRANK**:执行`/system/bin/procrank`命令,提供了一个按内存使用量排序的进程列表,有助于识别哪些进程占用了大量的系统资源。 5. **VIRTUALMEMORYSTATS**与**VMALLOCINFO**:这两个部分分别通过读取`/...
6. dumpstate 命令:android 系统调试辅助工具,生成可执行程式 dumpstate,建立两个程式 dumpcrash 和 bugreport 指向该程式。 7. dumpsys 命令:生成可执行程式 dumpsys。 8. ime 命令:IME 输入法 input method ...
这里包含了许多Android系统启动时使用的命令行工具,如`am`(Activity Manager)、`app_process`(Zygote进程的启动程序)、`backup`、`bmgr`(Backup Manager)、`bootanimation`(启动动画程序)、`dumpstate`、`...
### Android Framework 框架深度解析 Android Framework作为Android操作系统的核心组成部分,承载着连接底层硬件与上层应用程序的重要角色。它不仅提供了丰富的API供开发者调用,还负责管理各种系统服务,如进程...
首先,Android的日志系统主要包括五个级别:VERBOSE(V)、DEBUG(D)、INFO(I)、WARNING(W)、ERROR(E)和ASSERT(A)。开发者可以根据需要设置日志级别,以过滤无关或过于详尽的信息。在分析日志时,通常关注...
在【描述】中提到的`dumpstate_app_anr.log`文件,是Android系统在应用无响应(ANR,Application Not Responding)时生成的一种特殊日志。当用户界面长时间未响应用户操作时,系统会捕捉当前状态并生成此文件,以便...
Android LOG分析 Android LOG 是 Android 系统中的一种重要日志记录机制,用于记录系统和应用程序的运行状态、错误信息和事件信息。 Android LOG 分类为实时打印的 LOG 和状态信息的 LOG。 实时打印的 LOG 主要...
1. **日志级别与类型**:Android的日志系统支持五种不同的日志级别,包括`VERBOSE`、`DEBUG`、`INFO`、`WARN`和`ERROR`。开发者通常使用这些级别来控制日志输出的详细程度,`VERBOSE`是最详细的,而`ERROR`则表示...
在Android系统中,log文件是开发者诊断和调试应用问题的重要工具。本文将深入探讨如何分析一个名为`dumpstate_app_anr.log`的日志文件,它通常与ANR(Application Not Responding)错误有关,这是一种用户界面无响应...
本文档记录了Android系统开发的整个过程,从搭建Android开发环境到Android系统的架构、Android应用基础、Android系统基础、全志平台源码目录结构、Android启动流程、全志平台编译流程、系统调试方法、全志平台定制、...
在Android应用开发中,调试是不可或缺的一环,它能帮助开发者发现并修复代码中的问题。本文将介绍几个在Android中常用的App调试命令及其实践应用。 首先,`logcat`是Android开发者最熟悉的命令之一,用于查看设备或...
在Android开发中,日志(LOG)扮演着至关重要的角色,它可以帮助开发者诊断和解决应用程序中的问题。本文将通过一个具体的例子,即ANR(Application Not Responding)问题,来深入探讨如何利用LOG分析和解决Android...
4. **hprof-conv**:这个工具用于转换Android设备上生成的.hprof内存分析文件,使其能被更广泛的分析工具如MAT(Memory Analyzer Tool)读取,从而帮助开发者分析内存泄漏和性能问题。 5. **traceview**:一个图形...
### Android ADB命令详解 #### 一、ADB简介与工作原理 ADB(Android Debug Bridge)是一种用于Android设备的命令行工具,它允许开发者在计算机上与Android设备进行通信。ADB可以用于多种目的,如安装应用、文件...
平台工具(Platform Tools)是Android开发环境中的一个重要组成部分,它包含了一系列用于与Android设备交互的命令行工具。在“platform-tools_r28.0.2-windows”这个版本中,我们看到的是针对Windows操作系统的一个...
在Android系统中,日志文件扮演着至关重要的角色,它们提供了系统运行状态、应用程序行为以及错误信息的关键记录。本文将详细介绍Android平台上的主要日志类型,包括普通日志和异常日志,帮助开发者更好地理解和利用...
2. **dumpstate_board.txt** 和 **dumpstate_log.txt**:这两个文件是系统状态的详细快照,通常包含设备的硬件配置、系统服务状态、系统环境变量、运行进程等信息。它们为开发者提供了系统底层状态的深度洞察,有助...
6. **渲染名称解析工具**(如果包含):例如`dumpsys`, `dumpstate`等,这些工具可以获取Android系统的当前状态信息,如电池状态、运行服务等,对于故障排查和调试非常有用。 7. **AAPT (Android Asset Packaging ...