java - Find the class that waste the Memory -


i've published app several months ago in google play, of user have strong problem memory usage of app , true, because when checked memory usage "running application" tab, see take 80~110mb of memory, below picture:

enter image description here

to find class/activity or pieces of code cause problem found mat (memory analysis tools) plugin useful it's make me confused, please take account following image:

enter image description here

the total size of used memory 9.8mb "running application" tab show me 80mb @ same time!

the other problem histogram, shallow heap of byte[] object high.

is normal? when debug google project, byte value high!

enter image description here

so how can find using memory?

when android application starts, inherits objects allocated zygote - trick make application spawning faster. when memory dump show own.

the answer why zygote has memory allocation trick make resource loading faster. during android boot up, zygote preloads list of classes , resources other application doesn't need load them every time.

see zygoteinit.java#330 implementation of preloading.

heavy use of byte arrays due preloaded resources (which bitmaps).

see answer more concrete example of mat / byte array usage analysis definitive resource.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -