Android 性能优化(23)*性能工具之「Heap Viewer, Memory Monitor, Allocation Tracker」Memory Profilers
Memory Profilers
In this document
You should also read
1.简介
Heap Viewer, Memory Monitor, and Allocation Tracker are complementary tools that visualize the memory your app uses.
- Use the Memory Monitor Tool to find out whether undesirable garbage collection (GC) event patterns might be causing your performance problems.
Memory Monitor Tool 可分析出哪里有内存问题。
- Run Heap Viewer to identify object types that get or stay allocated unexpectedely or unecessarily.
Heap Viewer 标识出哪个对象是不必要的分配。
- Use Allocation Tracker to identify where in your code the problem might be.
Allocation Tracker 定位问题代码
2.Memory Monitor
- Shows available and used memory as they both change over time for your app in a graph, with dips indicating Garbage Collection (GC) events.
- Provides a quick way to test whether app slowness might be related to excessive GC events.
可测试是否由于过多的GC导致应用变慢。
- Provides a quick way to see whether app crashes might be related to running out of memory.
检查是否由于内存不足导致应用崩溃。
- Runs live on your application and updates about once a second.
- Helps quickly identify the potential of memory leaks.
标识潜在的内存泄漏。
- Helps identify GC patterns for your application and determine whether they are healthy and what you expect.
标识GC运行是否健康。
- Is easy to use, and it is easy to interpret what you see.
- However, Memory Monitor does not tell you which objects are the cause of your problems, or where in your code it might be.
它的缺点是并不能指出是哪个对象有问题,哪句代码有问题。

Figure 1. Memory Monitor.
3.Heap Viewer
- Shows snapshots of a number of objects allocated by type.
- Samples data every time a garbage collection event occurs naturally or triggered by you.
采集每次自动或手动GC的对象。
- Helps identify which object types might be involved in memory leaks.
标识出哪些对象可能与内存泄漏有关。
- However, you have to look for changes over time yourself by tracking what's happening in the graph.

4.Allocation Tracker
- Shows when and where your code allocates object types, their size, allocating thread, and stack traces.
记录内存分配信息。
- Helps recognize memory churn through recurring allocation/deallocation patterns.
识别重复无效的内存分配。
- Can be used in combination with Heap Viewer to track down memory leaks. For example, if you see a bitmap object resident on the heap, you can find its allocation location with Allocation Tracker.
帮助Heap Viewer, Memory Monitor 分析内存泄漏。
- However, it takes time and experience to learn to interpret the output from this tool.

Android 性能优化(23)*性能工具之「Heap Viewer, Memory Monitor, Allocation Tracker」Memory Profilers的更多相关文章
- Android开发学习之路--性能优化之常用工具
android性能优化相关的开发工具有很多很多种,这里对如下六个工具做个简单的使用介绍,主要有Android开发者选项,分析具体耗时的Trace view,布局复杂度工具Hierarchy Vie ...
- Android 性能优化 五 性能分析工具dumpsys的使用
Android提供的dumpsys工具能够用于查看感兴趣的系统服务信息与状态,手机连接电脑后能够直接命令行运行adb shell dumpsys 查看全部支持的Service可是这样输出的太多,能够通 ...
- Android性能优化第(三)篇---MAT比Menmery Monitor更强大
作者 LooperJing 2016.11.17 16:42* 字数 1687 阅读 1603评论 3喜欢 21 在Android性能优化第(一)篇---基本概念中讲了JAVA的四大引用,讲了一下GC ...
- MYSQL之性能优化 ----MySQL性能优化必备25条
今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显.关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我 们程序员需要去关注的事情.当我们去设计数据库表结构,对操作数 ...
- 前端性能优化jQuery性能优化
一.使用合适的选择器 $("#id"); 1.使用id来定位DOM元素无疑是最佳提高性能的方式,因为jQuery底层将直接调用本地方法document.getElementById ...
- Java程序性能优化之性能概述
性能的基本概念 一).什么叫程序的性能? 程序运行所需的内存和时间. 二).性能的表现形式: 1).执行速度: 程序的反应是否迅速,响应时间是否足够短. 2).启动时间:程序从运行到可以处理正常业务所 ...
- Android 性能优化(2)性能工具之「Hierarchy Viewer 」Optimizing Your UI:分析哪个view有性能问题,查看屏幕上某像素点的坐标,颜色等
Optimizing Your UI In this document Using Hierarchy Viewer Running Hierarchy Viewer and choosing a w ...
- Android 性能优化(22)*性能工具之「Hierarchy Viewer」 Hierarchy Viewer Walkthrough
Hierarchy Viewer Walkthrough 1.In this document Prerequisites Setting the ANDROID_HVPROTO variable W ...
- Android性能优化之Systrace工具介绍(一) _&& Systrace生成的trace.html打开空白或者打不开的解决办法
1.必须用Chrome打开 2.在mac电脑上,可能Chrome打开也是空白,解决办法是:在chrome地址栏中输入”chrome:tracing”,然后点击load按钮load你的trace.htm ...
随机推荐
- 程序猿是如何解决SQLServer占CPU100%的--马非码
http://www.cnblogs.com/marvin/p/ASolutionForSQLServerCauseHighCPU.html
- 移动端 js 实现图片上传 预览
方法一: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv=&q ...
- 必测的支付漏洞(一)——使用fiddler篡改支付金额
互联网产品中常会遇到支付功能,测试人员测试这部分功能时一定要重视,因为如果这部分出现了较严重的bug,将会给公司带来不小的经济损失!如果你测出了问题领导也一定会高兴的!因此测试优先级很高,但具有一定难 ...
- Ios开发之 -- js和ios的交互
==WebViewJavascriptBridge的介绍== #下载:https://github.com/marcuswestin/WebViewJavascriptBridge #关于WebVie ...
- react 项目实战(一)创建项目 及 服务端搭建
1.安装 React社区提供了众多的脚手架,这里我们使用官方推荐的create-react-app. //安装脚手架 npm install -g create-react-app //生成并运行项目 ...
- frameset怎样实现整个页面的跳转
登录页面login.jsp,系统登录成功后展示mainLayout.jsp, 我如今用frameset框架把页面mainLayout.jsp分为三部分,head.jsp..left.jsp.right ...
- HDU4930-Fighting the Landlords
题意:斗地主,就是要自己出牌.使得对手在这一轮无法出牌,或者有出牌的可能.可是你的牌已经走完了.假设符合这些条件的话,输出Yes.否则输出No. 思路:先预处理能直接把牌走完的情况,假设不行的话就直接 ...
- Mac OS 10.10.3下Apache + mod_wsgi配置【一】
[一] 首先,MAC是自带Apache的,在/private/etc/apache2路径下,能够使用apachectl -v查看版本号.我的版本号例如以下: Server version: Apach ...
- iOS tableview cell 的展开收缩
iOS tableview cell 的展开收缩 #import "ViewController.h" @interface ViewController ()<UITabl ...
- JavaScript基础 -- js常用内置方法和对象
JS中常用的内置函数如下: 1.eval(str):计算表达式的结果. 2.parseInt(str,n):将符串转换成整数数字形式(可指定几进制). 3.parseFloat(str):将字符串转换 ...