Memory Profilers

  Heap Viewer, Memory Monitor, and Allocation Tracker are complementary tools that visualize the memory your app uses.

  1. Use the Memory Monitor Tool to find out whether undesirable garbage collection (GC) event patterns might be causing your performance problems.

    Memory Monitor Tool 可分析出哪里有内存问题。
  2. Run Heap Viewer to identify object types that get or stay allocated unexpectedely or unecessarily.
    Heap Viewer 标识出哪个对象是不必要的分配。
  3. 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.

    

          Figure 2. Heap Viewer.

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.
     
        Figure 3. Allocation Tracker.
 
 
 

Android 性能优化(23)*性能工具之「Heap Viewer, Memory Monitor, Allocation Tracker」Memory Profilers的更多相关文章

  1. Android开发学习之路--性能优化之常用工具

      android性能优化相关的开发工具有很多很多种,这里对如下六个工具做个简单的使用介绍,主要有Android开发者选项,分析具体耗时的Trace view,布局复杂度工具Hierarchy Vie ...

  2. Android 性能优化 五 性能分析工具dumpsys的使用

    Android提供的dumpsys工具能够用于查看感兴趣的系统服务信息与状态,手机连接电脑后能够直接命令行运行adb shell dumpsys 查看全部支持的Service可是这样输出的太多,能够通 ...

  3. Android性能优化第(三)篇---MAT比Menmery Monitor更强大

    作者 LooperJing 2016.11.17 16:42* 字数 1687 阅读 1603评论 3喜欢 21 在Android性能优化第(一)篇---基本概念中讲了JAVA的四大引用,讲了一下GC ...

  4. MYSQL之性能优化 ----MySQL性能优化必备25条

    今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显.关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我 们程序员需要去关注的事情.当我们去设计数据库表结构,对操作数 ...

  5. 前端性能优化jQuery性能优化

    一.使用合适的选择器 $("#id"); 1.使用id来定位DOM元素无疑是最佳提高性能的方式,因为jQuery底层将直接调用本地方法document.getElementById ...

  6. Java程序性能优化之性能概述

    性能的基本概念 一).什么叫程序的性能? 程序运行所需的内存和时间. 二).性能的表现形式: 1).执行速度: 程序的反应是否迅速,响应时间是否足够短. 2).启动时间:程序从运行到可以处理正常业务所 ...

  7. Android 性能优化(2)性能工具之「Hierarchy Viewer 」Optimizing Your UI:分析哪个view有性能问题,查看屏幕上某像素点的坐标,颜色等

    Optimizing Your UI In this document Using Hierarchy Viewer Running Hierarchy Viewer and choosing a w ...

  8. Android 性能优化(22)*性能工具之「Hierarchy Viewer」 Hierarchy Viewer Walkthrough

    Hierarchy Viewer Walkthrough 1.In this document Prerequisites Setting the ANDROID_HVPROTO variable W ...

  9. Android性能优化之Systrace工具介绍(一) _&& Systrace生成的trace.html打开空白或者打不开的解决办法

    1.必须用Chrome打开 2.在mac电脑上,可能Chrome打开也是空白,解决办法是:在chrome地址栏中输入”chrome:tracing”,然后点击load按钮load你的trace.htm ...

随机推荐

  1. spring依赖注入中获取JavaBean

    一.这个接口有什么用? 当一个类实现了这个接口(ApplicationContextAware)之后,这个类就可以方便获得ApplicationContext中的所有bean.换句话说,就是这个类可以 ...

  2. mysql排序关于英文字母abcd..xyz排序。

    mysql会自动进行比如pxj,pyj. 再根据p进行排序时候,会自动进行第二个字母的排序 select * from tbl_actor where first_char like 'p%' ord ...

  3. SaltStack学习笔记之安装zabbix_agentd(jinja和pillar)

    一.环境说明 机器 IP 主机名 Master 192.168.0.23 minion.saltstack.com Minion 192.168.0.35 minion-node2.saltstack ...

  4. Linux 中浏览网页的命令行

    Linux系统环境的WEB网站浏览器工具,常用的有w3m.Links.Lynx三个工具 第一.w3m w3m文本浏览器是基于GPL协议发布的且支持表格.颜色.SSL连接以及内链图像,因速度快而著称. ...

  5. 关于函数return的一些理解与小实例

    先看代码: function example (){ var index=1; return {//像这种加个大括号的就是返回一个对象了,而不仅仅是一个值 index, net:function(){ ...

  6. 连通分量模板:tarjan: 求割点 && 桥 && 缩点 && 强连通分量 && 双连通分量 && LCA(近期公共祖先)

    PS:摘自一不知名的来自大神. 1.割点:若删掉某点后.原连通图分裂为多个子图.则称该点为割点. 2.割点集合:在一个无向连通图中,假设有一个顶点集合,删除这个顶点集合,以及这个集合中全部顶点相关联的 ...

  7. HTML5+CSS3设计界面

    近期在做一个关于房屋装修的手机上的项目,前台是用H5+C3完毕的,挂在微信上.全部相对来说不是非常难. 这段时间通过敲Html5+Css3.分享一些自己觉得值得学习的知识. 都非常easy.自己操作一 ...

  8. java.io.IOException: read failed, socket might closed or timeout, read ret: -1

    近期项目中连接蓝牙之后接收蓝牙设备发出的指令功能,在连接设备之后,创建RfcommSocket连接时候报java.io.IOException: read failed, socket might c ...

  9. web 开发之js---js 中的数组操作

    js数组元素的添加和删除一直比较迷惑,今天终于找到详细说明的资料了,先给个我测试的代码^-^var arr = new Array();arr[0] = "aaa";arr[1] ...

  10. 谈谈C++私有继承

    很多C++程序猿从来没用过私有继承来设计他的类.的确,假设是本该用私有继承的地方却用了公有继承.对程序的功能的实现并无影响. 但这样的误用是一种错位的描写叙述.会引起阅读者的误解,甚至会引起类的使用者 ...