Memory and CPU monitor

  Android Studio provides a memory and CPU monitor view so you can more easily monitor your app's performance and memory usage to track CPU usage, find deallocated objects, locate memory leaks, and track the amount of memory the connected device is using. With your app running on a device or emulator, click the Android tab in the lower left corner of the runtime window to launch the Android runtime window. Click the Memory or CPU tab.

        Figure 4. Monitor memory and CPU usage.

Heap dump

  When you're monitoring memory usage in Android Studio you can, at the same time, initiate garbage collection and dump the Java heap to a heap snapshot in an Android-specific HPROF binary format file. The HPROF viewer displays classes, instances of each class, and a reference tree to help you track memory usage and find memory leaks.

          Figure 5. HPROF viewer with heap dump.

  To create a snapshot of the Android app heap memory, click the Dump Java Heap icon () in the Memory Monitor. Android Studio creates the heap snapshot file with the filename Snapshot-yyyy.mm.dd-hh.mm.ss.hprof in the Captures tab. Double-click the heap snapshot file to open the HPROF viewer.

  To convert a heap dump to standard HPROF format in Android Studio, right-click a heap snapshot in the Captures view and select Export to standard .hprof.

Allocation tracker

  Android Studio allows you to track memory allocation as it monitors memory use. Tracking memory allocation allows you to monitor where objects are being allocated when you perform certain actions. Knowing these allocations enables you to adjust the method calls related to those actions to optimize your app's performance and memory use.

        Figure 6. Allocation tracker.

  For information about tracking and analyzing allocations, see Memory Monitor.

最新文章

  1. POJ 1061 同余方程
  2. WeX5之xid相关API
  3. 三维网格形变算法(Linear rotation-invariant coordinates和As-Rigid-As-Possible)
  4. zepto源码--isEmptyObject,isNumeric,inArray,trim--学习笔记
  5. [AIR] Screen 的应用
  6. sqlplus handbook
  7. 创建android 模拟器并在cmd中打开
  8. javascript . 05 json的组成、for...in 遍历对象、简单数据类型与复杂数据类型的传值与传址、内置对象
  9. perl多线程使用
  10. 基于Odoo框架的开源在线客服系统
  11. 什么是HTML DOM对象
  12. (转)Spring Boot (十四): Spring Boot 整合 Shiro-登录认证和权限管理
  13. jxl和POI的区别
  14. ImportError: No module named 'xml'
  15. 工控机安装Ubuntu14.04
  16. css 元素选择器实例
  17. es6 let关键字
  18. MySQL5.7.24安装笔记
  19. 【bzoj3295】[Cqoi2011]动态逆序对 树套树 线段树套替罪羊树
  20. SVM之核函数

热门文章

  1. 离职 mark
  2. Vue2.0如何自定义时间过滤器
  3. 九度oj 1179 阶乘
  4. MySql 执行计划解读
  5. sql自增长和占位符?"相矛盾"的问题
  6. [bzoj2038][2009国家集训队]小Z的袜子(hose)_莫队
  7. Codeforces 314B(倍增)
  8. MySQL Workbench查看和修改表字段的Comment值
  9. eclipse下载egit插件,实现代码git同步问题
  10. MySQL: 打开binlog选项后无法重启MySQL