Amira Elsayed Ismail
Amira Elsayed Ismail

Reputation: 9394

My android app consume a lot of memory

My app is consuming a lot of memory I have used the following app to measure my app memory consumption

https://play.google.com/store/apps/details?id=mem.usage&hl=en

can any one tell me how can I optimize the memory used by my app?

Upvotes: 3

Views: 3636

Answers (2)

toantran
toantran

Reputation: 1819

https://developer.android.com/tools/performance/comparison.html

Start with running Memory Profiler Tool to see what is the causes that leak/consume much memory in your app.

Upvotes: 0

Sanket Kachhela
Sanket Kachhela

Reputation: 10856

1) you can use LeakCanry for optimize memory. leakCanry will give you report for each individual leaks or when multiple instance of an activity will be on stack.

here is more info and integration guide https://github.com/square/leakcanary

2) you can check android studio memory monitor for your app's memory use. from that graph you can check when GC is being called and which activity or function is taking more memory so you can optimize through it.

more info regarding this http://developer.android.com/tools/performance/memory-monitor/index.html

3) i have gone through udacity tutorial and videos. you can see how to improving rendering for your layouts

  • Need to reduce unnecessary views.
  • dont apply unnecessary background.

more stuff https://www.udacity.com/course/android-performance--ud825

4) one more important thing use ApplicationContext where you can use it because Activity context keeps in stack and wont be eligible for GC until that context related task is being finished.

Upvotes: 9

Related Questions