SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Tuning Android
 Applications
    Copyright © 2011 CommonsWare, LLC
What I'll Be Yammering About
●   Now
    –   Traceview
    –   MAT
●   After the Keynote
    –   Battery and Bandwidth
    –   Top Ten Tuning Tips


                      Copyright © 2011 CommonsWare, LLC
Traceview
  Copyright © 2011 CommonsWare, LLC
Two Types of CPU Problems
●   Generally slow
    –   Foreground
    –   Background
●   UI “janky” (sluggish, jerky, non-responsive)
    –   Work being done on the main application thread
        that perhaps should not be


                      Copyright © 2011 CommonsWare, LLC
Finding Your CPU Problems
●   StrictMode
    –   Reports problems with main application thread
●   Roll-Your-Own Timing
    –   E.g., TimingLogger
●   Traceview
    –   Analyze method traces collected from VM
    –   Shows you where all the time goes
                      Copyright © 2011 CommonsWare, LLC
Collecting Trace Data
●   Start/Stop from DDMS
    –   Choose your process
    –   Toggle toolbar button
●   Start/Stop from Java
    –   android.os.Debug
    –   startMethodTracing()
    –   stopMethodTracing()

                      Copyright © 2011 CommonsWare, LLC
Loading Traceview
●   DDMS in Eclipse
    –   Stopping collection auto-loads Traceview
●   Standalone DDMS
    –   Stopping collection auto-loads standalone
        Traceview (Android 2.2+)
●   Trace-on-External-Storage
    –   Import into Eclipse
    –   Run traceview from command line
                      Copyright © 2011 CommonsWare, LLC
The Traceview Window
●   Top = Timeline
    –   Rows = threads
    –   Shows which threads were active at which times
        during test period
●   Bottom = CPU Consumers
    –   Call tree of methods, showing which methods
        are consuming what amount of time, calls
    –   Color coding matches timeline
                      Copyright © 2011 CommonsWare, LLC
Finding Hot Spots
●   Sort table
    –   Exclusive = time taken up just in this method
    –   Inclusive = time taken up in method and any
        methods it invokes (tree)
●   Find your code
    –   Appearing in left column
    –   In “parents” of other things consuming lots of
        time
                      Copyright © 2011 CommonsWare, LLC
Limitations
●   Disables JIT
    –   Result: all Java code slower than normal
●   Does Not Profile Native Code
    –   Result: native code a “black box”
●   Overall Result: Absolute Times Inaccurate
    –   Looking for relative times compared to other
        Java code

                      Copyright © 2011 CommonsWare, LLC
Memory Analysis
  with MAT
     Copyright © 2011 CommonsWare, LLC
Two Types of Memory Issues
●   Running out of heap
    –   OutOfMemoryError
●   Running out of stack
    –   StackOverflowError
    –   If stack trace shows mostly Android UI rendering
        code, use Hierarchy View to identify deepest
        portions of view hierachy, try to eliminate layers

                       Copyright © 2011 CommonsWare, LLC
Finding Your Heap Problems
●   Allocation Tracking
    –   Through DDMS, records all allocations
         ●   Exception: primitive arrays
    –   See who allocates what, try to figure out why
●   Memory Analyzer (MAT)
    –   Examine heap dump
    –   Find out what is not getting garbage collected
    –   Find out how many objects exist, sizes
                           Copyright © 2011 CommonsWare, LLC
Collecting Heap Dumps
●   From DDMS
    –   Select your process
    –   Click toolbar button
●   From Java
    –   android.os.Debug
    –   dumpHprofData()


                      Copyright © 2011 CommonsWare, LLC
Loading MAT
●   DDMS/Eclipse
    –   Dump automatically loaded into MAT
●   Standalone DDMS
    –   Run hprof-conv on HPROF file, then open in
        MAT
●   Java
    –   Copy file from emulator, run hprof-conv,
        open
                     Copyright © 2011 CommonsWare, LLC
Finding Your Leaks
●   Completely Closed Application
    –   All activities destroyed via BACK (or equivalent)
    –   In theory, none of your objects should appear
    –   Open the Histogram
    –   Enter package in “Regex” (com.yourfirm.*)
    –   See what crops up
         ●   “Merge Shortest Path to GC Roots” context menu,
             excluding weak references, to find out what is
             holding these Copyright © 2011 CommonsWare, LLC
                           things
Finding Where The Heap Went
●   Live Application
    –   Finding out where all the RAM is going
    –   Back in Histogram, sort by # of objects
    –   Looking for unusual stuff with lots of objects
         ●   Bitmaps
         ●   Your objects
         ●   Objects from third-party JAR


                            Copyright © 2011 CommonsWare, LLC
Finding Where The Heap Went
●   Live Application
    –   Bring up the Dominator Tree
    –   Sort by shallow heap (objects' own memory) or
        retained heap (memory object is responsible for)
    –   Again, hunt for unusual stuff with lots of heap




                       Copyright © 2011 CommonsWare, LLC
Limitations
●   Only Tracks Bitmaps on Honeycomb
    –   Previously was “native” memory, counted
        against heap but not visible to MAT
    –   Recommendation
         ●   Focus MAT use on Honeycomb
         ●   Secondary usage on earlier OS levels




                          Copyright © 2011 CommonsWare, LLC

Más contenido relacionado

Destacado

Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
Droidcon Berlin
 
Android Performance Best Practices
Android Performance Best Practices Android Performance Best Practices
Android Performance Best Practices
Amgad Muhammad
 
Java Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and TuningJava Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and Tuning
Carol McDonald
 

Destacado (19)

Performance optimization for Android
Performance optimization for AndroidPerformance optimization for Android
Performance optimization for Android
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
Tuning android for low ram devices
Tuning android for low ram devicesTuning android for low ram devices
Tuning android for low ram devices
 
Android Performance Best Practices
Android Performance Best Practices Android Performance Best Practices
Android Performance Best Practices
 
Objective-C for Java Developers
Objective-C for Java DevelopersObjective-C for Java Developers
Objective-C for Java Developers
 
Java Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and TuningJava Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and Tuning
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Layer architecture of ios (1)
Layer architecture of ios (1)Layer architecture of ios (1)
Layer architecture of ios (1)
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
MySQL Performance Tuning: Top 10 Tips
MySQL Performance Tuning: Top 10 TipsMySQL Performance Tuning: Top 10 Tips
MySQL Performance Tuning: Top 10 Tips
 
Google ART (Android RunTime)
Google ART (Android RunTime)Google ART (Android RunTime)
Google ART (Android RunTime)
 
Designing better user interfaces
Designing better user interfacesDesigning better user interfaces
Designing better user interfaces
 
Android & iOS Automation Using Appium
Android & iOS Automation Using AppiumAndroid & iOS Automation Using Appium
Android & iOS Automation Using Appium
 
Architecting iOS Project
Architecting iOS ProjectArchitecting iOS Project
Architecting iOS Project
 
iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)iOS for Android Developers (with Swift)
iOS for Android Developers (with Swift)
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
Android vs iPhone - Differences in UI Patterns and Design
Android vs iPhone - Differences in UI Patterns and DesignAndroid vs iPhone - Differences in UI Patterns and Design
Android vs iPhone - Differences in UI Patterns and Design
 
Ios vs android
Ios vs androidIos vs android
Ios vs android
 
iOS design: a case study
iOS design: a case studyiOS design: a case study
iOS design: a case study
 

Similar a Tuning Android Applications (Part One)

Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
WSO2
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)
Marcos García
 

Similar a Tuning Android Applications (Part One) (20)

X Means Y
X Means YX Means Y
X Means Y
 
Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)Tuning Android Applications (Part Deux)
Tuning Android Applications (Part Deux)
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
App Integration (Revised and Updated)
App Integration (Revised and Updated)App Integration (Revised and Updated)
App Integration (Revised and Updated)
 
From Android to the Mobile Web
From Android to the Mobile WebFrom Android to the Mobile Web
From Android to the Mobile Web
 
App integration: Strategies and Tactics
App integration: Strategies and TacticsApp integration: Strategies and Tactics
App integration: Strategies and Tactics
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Android Memory , Where is all My RAM
Android Memory , Where is all My RAM
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Android Application WebAPI Development Training
Android Application WebAPI Development TrainingAndroid Application WebAPI Development Training
Android Application WebAPI Development Training
 
Securing User Data with SQLCipher
Securing User Data with SQLCipherSecuring User Data with SQLCipher
Securing User Data with SQLCipher
 
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??![충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
 
Eliminating the Pauses in your Java Application
Eliminating the Pauses in your Java ApplicationEliminating the Pauses in your Java Application
Eliminating the Pauses in your Java Application
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)
 
On non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits andOn non existent 0-days, stable binary exploits and
On non existent 0-days, stable binary exploits and
 
Java introduction
Java introductionJava introduction
Java introduction
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 

Más de CommonsWare

Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
CommonsWare
 

Más de CommonsWare (20)

Gradle and Your Android Wearable Projects
Gradle and Your Android Wearable ProjectsGradle and Your Android Wearable Projects
Gradle and Your Android Wearable Projects
 
Getting Android Developers for Your Wearables
Getting Android Developers for Your WearablesGetting Android Developers for Your Wearables
Getting Android Developers for Your Wearables
 
When Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable AppsWhen Microwatts Are Precious: Battery Tips for Wearable Apps
When Microwatts Are Precious: Battery Tips for Wearable Apps
 
The Action Bar: Front to Back
The Action Bar: Front to BackThe Action Bar: Front to Back
The Action Bar: Front to Back
 
Android Security: Defending Your Users
Android Security: Defending Your UsersAndroid Security: Defending Your Users
Android Security: Defending Your Users
 
Secondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManagerSecondary Screen Support Using DisplayManager
Secondary Screen Support Using DisplayManager
 
Mastering the Master Detail Pattern
Mastering the Master Detail PatternMastering the Master Detail Pattern
Mastering the Master Detail Pattern
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful Threading
 
Android Development: The 20,000-Foot View
Android Development: The 20,000-Foot ViewAndroid Development: The 20,000-Foot View
Android Development: The 20,000-Foot View
 
Maps V2... And You!
Maps V2... And You!Maps V2... And You!
Maps V2... And You!
 
A Deep Dive Into ViewPager
A Deep Dive Into ViewPagerA Deep Dive Into ViewPager
A Deep Dive Into ViewPager
 
Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2Second-Screen Support in Android 4.2
Second-Screen Support in Android 4.2
 
Integrate Android Apps and Web Apps
Integrate Android Apps and Web AppsIntegrate Android Apps and Web Apps
Integrate Android Apps and Web Apps
 
The Wonderful World of Wearables
The Wonderful World of WearablesThe Wonderful World of Wearables
The Wonderful World of Wearables
 
Beaming Data to Devices with NFC
Beaming Data to Devices with NFCBeaming Data to Devices with NFC
Beaming Data to Devices with NFC
 
What's New in Jelly Bean
What's New in Jelly BeanWhat's New in Jelly Bean
What's New in Jelly Bean
 
Making Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business ModelsMaking Money at Mobile: 60 Business Models
Making Money at Mobile: 60 Business Models
 
AppsWorld Keynote
AppsWorld KeynoteAppsWorld Keynote
AppsWorld Keynote
 
Rich Text Editing and Beyond
Rich Text Editing and BeyondRich Text Editing and Beyond
Rich Text Editing and Beyond
 
Backwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and TacticsBackwards Compatibility: Strategies and Tactics
Backwards Compatibility: Strategies and Tactics
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Tuning Android Applications (Part One)

  • 1. Tuning Android Applications Copyright © 2011 CommonsWare, LLC
  • 2. What I'll Be Yammering About ● Now – Traceview – MAT ● After the Keynote – Battery and Bandwidth – Top Ten Tuning Tips Copyright © 2011 CommonsWare, LLC
  • 3. Traceview Copyright © 2011 CommonsWare, LLC
  • 4. Two Types of CPU Problems ● Generally slow – Foreground – Background ● UI “janky” (sluggish, jerky, non-responsive) – Work being done on the main application thread that perhaps should not be Copyright © 2011 CommonsWare, LLC
  • 5. Finding Your CPU Problems ● StrictMode – Reports problems with main application thread ● Roll-Your-Own Timing – E.g., TimingLogger ● Traceview – Analyze method traces collected from VM – Shows you where all the time goes Copyright © 2011 CommonsWare, LLC
  • 6. Collecting Trace Data ● Start/Stop from DDMS – Choose your process – Toggle toolbar button ● Start/Stop from Java – android.os.Debug – startMethodTracing() – stopMethodTracing() Copyright © 2011 CommonsWare, LLC
  • 7. Loading Traceview ● DDMS in Eclipse – Stopping collection auto-loads Traceview ● Standalone DDMS – Stopping collection auto-loads standalone Traceview (Android 2.2+) ● Trace-on-External-Storage – Import into Eclipse – Run traceview from command line Copyright © 2011 CommonsWare, LLC
  • 8. The Traceview Window ● Top = Timeline – Rows = threads – Shows which threads were active at which times during test period ● Bottom = CPU Consumers – Call tree of methods, showing which methods are consuming what amount of time, calls – Color coding matches timeline Copyright © 2011 CommonsWare, LLC
  • 9. Finding Hot Spots ● Sort table – Exclusive = time taken up just in this method – Inclusive = time taken up in method and any methods it invokes (tree) ● Find your code – Appearing in left column – In “parents” of other things consuming lots of time Copyright © 2011 CommonsWare, LLC
  • 10. Limitations ● Disables JIT – Result: all Java code slower than normal ● Does Not Profile Native Code – Result: native code a “black box” ● Overall Result: Absolute Times Inaccurate – Looking for relative times compared to other Java code Copyright © 2011 CommonsWare, LLC
  • 11. Memory Analysis with MAT Copyright © 2011 CommonsWare, LLC
  • 12. Two Types of Memory Issues ● Running out of heap – OutOfMemoryError ● Running out of stack – StackOverflowError – If stack trace shows mostly Android UI rendering code, use Hierarchy View to identify deepest portions of view hierachy, try to eliminate layers Copyright © 2011 CommonsWare, LLC
  • 13. Finding Your Heap Problems ● Allocation Tracking – Through DDMS, records all allocations ● Exception: primitive arrays – See who allocates what, try to figure out why ● Memory Analyzer (MAT) – Examine heap dump – Find out what is not getting garbage collected – Find out how many objects exist, sizes Copyright © 2011 CommonsWare, LLC
  • 14. Collecting Heap Dumps ● From DDMS – Select your process – Click toolbar button ● From Java – android.os.Debug – dumpHprofData() Copyright © 2011 CommonsWare, LLC
  • 15. Loading MAT ● DDMS/Eclipse – Dump automatically loaded into MAT ● Standalone DDMS – Run hprof-conv on HPROF file, then open in MAT ● Java – Copy file from emulator, run hprof-conv, open Copyright © 2011 CommonsWare, LLC
  • 16. Finding Your Leaks ● Completely Closed Application – All activities destroyed via BACK (or equivalent) – In theory, none of your objects should appear – Open the Histogram – Enter package in “Regex” (com.yourfirm.*) – See what crops up ● “Merge Shortest Path to GC Roots” context menu, excluding weak references, to find out what is holding these Copyright © 2011 CommonsWare, LLC things
  • 17. Finding Where The Heap Went ● Live Application – Finding out where all the RAM is going – Back in Histogram, sort by # of objects – Looking for unusual stuff with lots of objects ● Bitmaps ● Your objects ● Objects from third-party JAR Copyright © 2011 CommonsWare, LLC
  • 18. Finding Where The Heap Went ● Live Application – Bring up the Dominator Tree – Sort by shallow heap (objects' own memory) or retained heap (memory object is responsible for) – Again, hunt for unusual stuff with lots of heap Copyright © 2011 CommonsWare, LLC
  • 19. Limitations ● Only Tracks Bitmaps on Honeycomb – Previously was “native” memory, counted against heap but not visible to MAT – Recommendation ● Focus MAT use on Honeycomb ● Secondary usage on earlier OS levels Copyright © 2011 CommonsWare, LLC