简体   繁体   中英

understanding the heap button in Android DDMS - device tab

when we place an application in debug mode - a DDMS window pops up. There is a device tab with a "heap" button. it has all kinds of information in it. I struggle to see how this information can help me. Can you provide me just one easy practical use for this information ? I tried to look through documentation but could not find anything.

Heap is a place in memory where all created objects are stored. Object is placed in heap when you use new statement. You can review actual state of heap using MAT(Memory Analysis for Android Applications ). To do this you must:

  1. Install MAT.
  2. Run application in debug mode(but not necessarily) and click update heap. Now heap is copied from android device to your pc.
  3. Click Dump HPROF file which allows you to save .hprof file to you hard drive.
  4. Use hprof-conv tool which is placed in sdk\\tools. If you want use this in any place you must add sdk\\tools to your PATH environment variable.
  5. To run hprof-conv type in command line: hprof-conv dump.hprof converted-dump.hprof
  6. Now you can open newly created file in MAT.

More detailed description is here : Memory analysis for Android Application

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM