`
jonson
  • 浏览: 164772 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

android 内存占用 分析工具

阅读更多

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信息

 

 

 

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 . 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. 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 , 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 . 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

1
3
分享到:
评论

相关推荐

    android应用内存监控工具

    android应用内存监控工具,

    android内存分析工具

    分析oom的利器,内存分析工具eclipse插件

    获取android 内存占用工具

    adb连上android 设备(如手机) 运行mem_shell.bat ,再运行mem.exe,就可以获取android 设备详细内存将附件截图

    android应用内存占用测试(每隔一秒打印procrank的信息)

    使用procrank工具进行,android应用内存占用测试,写python脚本,每隔一秒打印procrank的信息

    Android分析Bugreport开源工具

    导出的html文件包含了根据bugreport数据得出的图表和分析结论,主要包括进程内存占用信息、程序ANR或crash的堆栈信息、电池信息、CPU频率信息等等。更多详细内容可以参考文章...

    android内存监测之procrank

    android内存监测之procrank Android系统中提供了两个命令行工具procrank、procmem用于查看系统中的内存使用情况。这两个工具对于我们分析内存相关问题非常有效。由于Android系统使用的是Linux内核,理论上这样的...

    Android内存泄漏解决方案

    Android ADT自带有内存检测工具,可以查看内存的占用情况,但是无法查看内存的详细信息, 我们需要安装Eclipse的内存分析工具MAT插件,来dump 出详细的内存情况,进行分析

    android内存监测之procmem

    【android内存监测之procmem】 Android系统中提供了两个命令行工具procrank、procmem用于查看系统中的内存使用情况。这两个工具对于我们... • procmem可以针对某个特定的进程分析其堆、栈、共享库等内存占用情况。

    Linx - Android 抓内存工具

    抓内存工具,用于分析内存占用及内存泄露等问题 (Uss_Vss_Rss_Pss) PID Vss Rss Pss Uss cmdlineA 708 117204K 38304K 31315K 28956K /vendor/bin/hw/android.hardware.camera.provider@2.4-service 535 ...

    总结Android App内存优化之图片优化

    前言 ...通过DDMS的APP内存占用查看工具分析发现,APP中占用内存最多的是图片,每个Activity中图片占用内存占大半,本文重点分享对图片的内存优化。 不要将Button的背景设置为selector   在布局

    Android APK性能测试 procrank等工具

    Android APK性能测试 procrank等工具,包括CPU,进程内存占用等各方面测试。

    GDA分析工具

    GDA是一款强大而轻便的交互式反编译器,也是一款综合性逆向分析利器, 本软件具有分析速度快、体积小、内存占用少等优点。 软件无需安装java环境和android环境就可以使用,支持分析apk,dex,odex,oat类型文件, ...

    记一次MAT内存分析

    记录一次内存分析的简单实践,目的是找出占用内存较大的对象和无效的内存分配 2、工具 2.1、 DDMS或者Android Studio DDMS:抓取内存快照 Android Studio的Profiler:抓取内存快照并分析(支持android 5.0以上) 2.2...

    Android CPU 压力测试

    经测试在MTK平台1G内存4核CPU占用比在50%左右,偶尔可能会达到70%以上。 超过3D游戏及其它任何应用。 当应用占用CPU比超过一定系统的值后,会产生大量ANR(应用 无响应)请选择等待。 如: User 63%, System 31%, ...

    Node.js-Android性能测试工具Emmagee

    Emmagee是监控指定被测应用在使用过程中占用机器的CPU、内存、流量资源的性能测试小工具。

    新版Android开发教程.rar

    � 采用了对有限内存、电池和 CPU 优化过的虚拟机 Dalvik , Android 的运行速度比想象的要快很多。 � 运营商(中国移动等)的大力支持,产业链条的热捧。 � 良好的盈利模式( 3/7 开),产业链条的各方:运营商、...

    Android开发之超强图片工具类BitmapUtil完整实例

    本文实例讲述了Android开发之超强图片工具类BitmapUtil。分享给大家供大家参考,具体如下: 说明:为了方便大家使用,本人把大家常用的图片处理代码集中到这个类里 使用了LruCache与SoftReference /** * 图片加载...

    串口监控抓包工具-SerialSpy

    利用过滤驱动自己开发的串行口抓包程序,不会占用用户态的串口句柄。 使用方法: 1: 解包 2:运行SerSpyInst.exe安装监控设备 3:运行SerialSpy.exe即可. <br>同类的程序有PortMon,SerialMonitor, ...

    Android项目常用图片特效处理.rar

    此外,资源中的代码均经过优化,以确保在性能和内存占用方面达到最佳效果。同时,我们还提供了详细的文档和示例代码,以帮助开发者快速上手和理解各项功能的使用方法。 总之,Android项目常用图片特效处理.rar是一...

    Lunar Mobile Console - PRO 1.6.4 专业版高性能ios/android log工具

    具有低内存占用的本机 C/Objective-C/Java 代码。 适用于大型日志数量( 最多 65536个条目)。 完全使用本机 ios/android用户界面( 不依赖统一 GUI ) 构建。 分辨率独立( 在 highres/Retina 显示器上看起来不错)。 不...

Global site tag (gtag.js) - Google Analytics