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

Android performance tuning. Memory.

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Android performance tuning. Memory.

Avatar for Sergii Kozyrev

Sergii Kozyrev

October 23, 2016
Tweet

More Decks by Sergii Kozyrev

Other Decks in Programming

Transcript

  1. Understanding memory •GC •Find objects that can’t be accessed •Reclaim

    the resources •Questions: •Heap vs Stack memory? •What GC collects? •How leaks happens?
  2. Memory Leaks •It’s not only about OutOfMemoryError •It reduces available

    memory and causes GC run more frequent - which is bad
  3. Different VMs – different Logs •Dalvik (every GC) •ART (if

    the GC pause exceeds than 5ms or the GC duration exceeds 100ms) Concurrent VS Alloc
  4. Memory Leaks •Simple - “handler case”, or every circular referenced

    objects •Complex - holding a handle to the ClassLoader objects, load in onCreate and don’t check if classes already loaded (no class unload procedure)
  5. Memory Leaks •Static Activities, Views, Context aware stuff •Inner Classes

    •Anonymous Classes •Handlers •Threads and TimerTask •Sensor Manager