Movatterモバイル変換


[0]ホーム

URL:


UA  Mobile, profile picture
Uploaded byUA Mobile
PDF, PPTX842 views

Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android

The document discusses memory analysis and optimization tips for Android applications. It introduces the Eclipse Memory Analyzer tool, which can be used to analyze memory usage and find memory leaks. Some key points covered include the low RAM sizes on Android devices, how the garbage collector works, how to analyze an object's shallow size and retained size, finding memory dominators, and common memory leak pitfalls like non-static handlers and large bitmaps stored in static fields. The document encourages analyzing heap dumps in the Memory Analyzer tool to optimize memory usage and find leaks.

Embed presentation

Download as PDF, PPTX
MEMORY ANALYZER TOOLAND MEMORY OPTIMIZATIONTIPS IN ANDROID    Olexandr Tereshchuk
Memory efficiency
Problem   Low RAM size – 256MB to 512MB on    most of devices.   Low CPU performance – harder to    perform full GC.   Each application works in it’s own    process and VM instance.   Large system library.
Zygote
Zygote – closer look
DEX
DEX – closer look
Garbage Collection:Mark and Sweep
Garbage Collection:Concurrent Mark and Sweep   initial mark — stop-the-world.   mark — Concurrent.   preclean — Concurrent.   remark — Stop-the-world.   sweep — Concurrent.
Garbage Collection:Concurrent Mark and Sweep
Eclipse Memory Analyzer Tool
Shallow sizeShallow size of an object is the amount of memoryallocated to store the object itself, not taking intoaccount the referenced objects == Sum of the size ofthe “object header”     and the fields of an object
Retained size   Retained set of X       The set of objects that would be reclaimed, if we        could delete Object X   Retained size of X       The Retained size of an object X is equal to the        shallow size of the „Retained sets“ of X
Demo
Dominator Tree   X dominates Y, if all paths from a GC Root    to Y go via X. “X is a Dominator of Y”   The closest Dominator to Y is called    “immediate Dominator”
Immediate Dominator
Immediate Dominator
Immediate Dominator
Immediate Dominator
Immediate Dominator
Demo
Common pitfalls
“Static” Drawableprivate static Drawable sBackground;  @Override  protected void onCreate(final Bundle state) {    super.onCreate(state);    final TextView label = new TextView(this);    label.setText("Leaks are bad");    if (sBackground == null) {      sBackground = getDrawable(R.drawable.large_bitmap);    }    label.setBackground(sBackground);    setContentView(label);  }
Non-static Handler classpublic class MyActivity extends Activity {   Handler myhandler = new Handler() { ... }; }
WebView (only for 2.x)
View.setTag(key,tag) - pre 4.0public static class MainActivity extends Activity {   private final WeakHashMap<Parent, Parent.Child> mMap = new WeakHashMap<Parent, Parent.Child>();    @Override    public void onCreate(final Bundle savedInstanceState) {      super.onCreate(savedInstanceState);        // If parents were collected OOM error wouldn't be thrown. But they aren't collected so we get OOM here.        for (int i = 0; i < 1000; ++i) {          final Parent parent = new Parent();          mMap.put( parent, parent.mChild );        }    }}public static class Parent {  public final Child mChild = new Child();    public class Child { private final byte[] mJunk = new byte[10*1024*1024]; }}
Questions ?
The EndEmail: atereshchuk@stanfy.com.uaSkype: rivne2

Recommended

PDF
Mongodb debugging-performance-problems
PDF
MongoDB Performance Debugging
PDF
Core Data with multiple managed object contexts
PDF
Testing orm based code
PDF
Lazy evaluation drupal camp moscow 2014
PDF
Create a Core Data Observer in 10mins
PDF
Broker otw.pptx
PDF
Bristol 2009 q1_wright_steve
PDF
Cassandra at BrightTag
KEY
Geo & capped collections with MongoDB
PDF
Optimizing Slow Queries with Indexes and Creativity
PPT
Hibernate caching
 
PDF
Hibernate caching
PDF
C SQLite usage
PDF
The Tale of a Smooth RecyclerView
PDF
MySQL flexible schema and JSON for Internet of Things
PDF
Google App Engine Developer - Day3
PPT
React.js 20150828
PPTX
Event-driven IO server-side JavaScript environment based on V8 Engine
PPTX
Instroduce Hazelcast
PDF
MySQL Document Store -- SCaLE 17x Presentation
KEY
第三回月次セミナー(公開版)
PDF
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
PDF
Drools Workshop @JBCNCONF 2016
PDF
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
PDF
MongoDB Indexing Constraints and Creative Schemas
PDF
Devel::NYTProf v5 at YAPC::NA 201406
PDF
Workshop - Linux Memory Analysis with Volatility

More Related Content

PDF
Mongodb debugging-performance-problems
PDF
MongoDB Performance Debugging
PDF
Core Data with multiple managed object contexts
PDF
Testing orm based code
PDF
Lazy evaluation drupal camp moscow 2014
PDF
Create a Core Data Observer in 10mins
PDF
Broker otw.pptx
PDF
Bristol 2009 q1_wright_steve
Mongodb debugging-performance-problems
MongoDB Performance Debugging
Core Data with multiple managed object contexts
Testing orm based code
Lazy evaluation drupal camp moscow 2014
Create a Core Data Observer in 10mins
Broker otw.pptx
Bristol 2009 q1_wright_steve

What's hot

PDF
Cassandra at BrightTag
KEY
Geo & capped collections with MongoDB
PDF
Optimizing Slow Queries with Indexes and Creativity
PPT
Hibernate caching
 
PDF
Hibernate caching
PDF
C SQLite usage
PDF
The Tale of a Smooth RecyclerView
PDF
MySQL flexible schema and JSON for Internet of Things
PDF
Google App Engine Developer - Day3
PPT
React.js 20150828
PPTX
Event-driven IO server-side JavaScript environment based on V8 Engine
PPTX
Instroduce Hazelcast
PDF
MySQL Document Store -- SCaLE 17x Presentation
KEY
第三回月次セミナー(公開版)
PDF
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
PDF
Drools Workshop @JBCNCONF 2016
PDF
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
PDF
MongoDB Indexing Constraints and Creative Schemas
Cassandra at BrightTag
Geo & capped collections with MongoDB
Optimizing Slow Queries with Indexes and Creativity
Hibernate caching
 
Hibernate caching
C SQLite usage
The Tale of a Smooth RecyclerView
MySQL flexible schema and JSON for Internet of Things
Google App Engine Developer - Day3
React.js 20150828
Event-driven IO server-side JavaScript environment based on V8 Engine
Instroduce Hazelcast
MySQL Document Store -- SCaLE 17x Presentation
第三回月次セミナー(公開版)
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
Drools Workshop @JBCNCONF 2016
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
MongoDB Indexing Constraints and Creative Schemas

Viewers also liked

PDF
Devel::NYTProf v5 at YAPC::NA 201406
PDF
Workshop - Linux Memory Analysis with Volatility
PPT
Linux memory consumption
 
PPT
PCD - Process control daemon - Presentation
 
PDF
Crash_Report_Mechanism_In_Tizen
 
PPTX
Process control daemon
 
PDF
LCA13: Memory Hotplug on Android
 
PPTX
Android Performance Best Practices
PDF
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
 
PDF
Tuning Android for low RAM
PDF
Tuning android for low ram devices
PPTX
Android Rooting and Flashing
DOCX
animatronics pdf
PPT
Stan winston & animatronics
PDF
Perl Memory Use 201209
PPTX
Memory in Android
PDF
Android Memory , Where is all My RAM
PPT
Android introduction and rooting technology
PDF
Poster_Jan
PPT
Android rooting
Devel::NYTProf v5 at YAPC::NA 201406
Workshop - Linux Memory Analysis with Volatility
Linux memory consumption
 
PCD - Process control daemon - Presentation
 
Crash_Report_Mechanism_In_Tizen
 
Process control daemon
 
LCA13: Memory Hotplug on Android
 
Android Performance Best Practices
Controlling Memory Footprint at All Layers: Linux Kernel, Applications, Libra...
 
Tuning Android for low RAM
Tuning android for low ram devices
Android Rooting and Flashing
animatronics pdf
Stan winston & animatronics
Perl Memory Use 201209
Memory in Android
Android Memory , Where is all My RAM
Android introduction and rooting technology
Poster_Jan
Android rooting

Similar to Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android

PDF
Android UI Development: Tips, Tricks, and Techniques
PDF
Eclipse Memory Analyzer Tool
PDF
performance optimization: Memory
PDF
Android UI Tips, Tricks and Techniques
PDF
Performance #1: Memory
PPTX
Performance #1 memory
PDF
Memory Leaks in Android Applications
PDF
Memory management
PDF
Android memory and performance optimization
PDF
Android memory and performance optimization
PDF
Android memory and performance optimization
PPTX
Why learn Internals?
PPTX
Сергей Жук "Android Performance Tips & Tricks"
 
PPTX
Android Performance Tips & Tricks
PPTX
Andromance - Android Performance
PPTX
Android app performance
PDF
The Good, the Bad and the Ugly things to do with android
PDF
X Means Y
PPTX
How to deal with Fragmentation on Android
PDF
Android dev tips
Android UI Development: Tips, Tricks, and Techniques
Eclipse Memory Analyzer Tool
performance optimization: Memory
Android UI Tips, Tricks and Techniques
Performance #1: Memory
Performance #1 memory
Memory Leaks in Android Applications
Memory management
Android memory and performance optimization
Android memory and performance optimization
Android memory and performance optimization
Why learn Internals?
Сергей Жук "Android Performance Tips & Tricks"
 
Android Performance Tips & Tricks
Andromance - Android Performance
Android app performance
The Good, the Bad and the Ugly things to do with android
X Means Y
How to deal with Fragmentation on Android
Android dev tips

More from UA Mobile

PDF
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
PDF
Олег Апостол - Плюсы и минусы различных тач-платформ глазами веб-разработчика
PDF
Вадим Розов- Разработка под Blackberry. Подводные грабли
PDF
Mobile automation uamobile
PDF
Михаил Галушко - Разработка WinRT приложений для Windows 8: реальный опыт
PDF
Денис Лебедев-Управление зависимостями с помощью CocoaPods
PDF
Павел Юрийчук - Разработка приложений под мобильные браузеры
PDF
Александр Додатко - Работа с датами в ObjectiveC и SQLite
PDF
Владимир Кириллов-TCP-Performance for-Mobile-Applications
PDF
Tdd objective c
PDF
Сергей Арнаут - Stream yourself with Android
PDF
Максим Щеглов - Google Cloud Messaging for Android
PDF
Дмитрий Малеев-Мобильная Геймификация или как вырабатывать-привычки
PDF
Алексей Лельчук - От аутсорсинга к продуктам: трансформация компании и ментал...
PDF
Евгений Галкин-Рекламные возможности Google для продвижения мобильных приложений
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
Олег Апостол - Плюсы и минусы различных тач-платформ глазами веб-разработчика
Вадим Розов- Разработка под Blackberry. Подводные грабли
Mobile automation uamobile
Михаил Галушко - Разработка WinRT приложений для Windows 8: реальный опыт
Денис Лебедев-Управление зависимостями с помощью CocoaPods
Павел Юрийчук - Разработка приложений под мобильные браузеры
Александр Додатко - Работа с датами в ObjectiveC и SQLite
Владимир Кириллов-TCP-Performance for-Mobile-Applications
Tdd objective c
Сергей Арнаут - Stream yourself with Android
Максим Щеглов - Google Cloud Messaging for Android
Дмитрий Малеев-Мобильная Геймификация или как вырабатывать-привычки
Алексей Лельчук - От аутсорсинга к продуктам: трансформация компании и ментал...
Евгений Галкин-Рекламные возможности Google для продвижения мобильных приложений

Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android


[8]ページ先頭

©2009-2025 Movatter.jp