Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Extracts from "Memory Management for Android Apps"

Extracts from "Memory Management for Android Apps"

Extracts from "Memory Management for Android Apps"

David Wu

July 06, 2011
Tweet

More Decks by David Wu

Other Decks in Programming

Transcript

  1. Extracts from "Memory Management for Android Apps" Taipei GTUG 20110706

    Meetup (http://goo.gl/VdfLK) Original Presenter Patrick Dubroy @dubroy Extract Presenter David Wu @wuman blog.wu-man.com
  2. 5 Breakdown API Changes  Heap size  Garbage collection

     Bitmap allocations Understanding heap usage  Memory leaks  Logcat  Memory Analyzer (MAT)
  3. 6 Heap Size  Heap size limits  G1: 16MB

     Droid: 24MB  Nexus One: 32MB  Xoom: 48MB  ActivityManager.getMemoryClass()
  4. 12 Garbage Collection  < Gingerbread  Stop-the-world  Full

    heap collection  Pause times often > 100ms  >= Gingerbread  Concurrent (mostly)  Partial collections  Pause times usually < 5ms
  5. 22 Heap Dumps  Create with  DDMS  andorid.os.Debug.dumpHprofData()

     Conversion  hprof-conv orig.hprof converted.hprof  Analyze with MAT
  6. 27 References  Video of the session http://goo.gl/KRrx7  Original

    slides http://goo.gl/0RqIZ  Patrick Dubroy's blog http://dubroy.com/blog/