Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the normal pictures allocated a lot of memory?
    primarykey
    data
    text
    <p>My application use a little memory, it's about 3.4MB, in some old android devices such as GT-I9001. But when i running it in HTC one, my application use very more memory.</p> <p><img src="https://i.stack.imgur.com/b9mt7.png" alt="enter image description here"></p> <p>Look, the allocated memory is 26.881MB, it's too big, and the free memory only have 2.940MB. Then i use MAT tool check the memory leak, i find the resource bitmap use mach memory.</p> <p>I can't explain the reason. My application often out of memory. I think Maybe the problem is caused by high screen resolution. If someone also encountered this problem, please join the discussion, thanks!</p> <p>I debuged the problem, and found some reason: </p> <p><img src="https://i.stack.imgur.com/TL0jG.png" alt="enter image description here"></p> <p>The onCreate() function in my start activity, and you can see the breakpoint. The application only use allocated memory 3.4MB before calling the setContentView(R.layout.welcome) to load layout xml. Then the application run to next step, it use allocated memory 19MB. So i think this problem must be caused by loading the layout xml.</p> <p>I modifed the "welcome.xml" file, deleted all widgets, that only have a "RelativeLayout"</p> <p><img src="https://i.stack.imgur.com/ttTfW.png" alt="enter image description here"></p> <p>But the program also use 19MB memory. Finally, i deleted the backgroud of RelativeLayout and the program memory return to normal size, it only use 3MB.</p> <p>The size of pictrue "loading_background.png" is only 21KB, i think that perhaps the high screen resolution of high-end device changed the picture size in memory, i will try to use 9.png picture. If you understand this part of the problem, please join the discussion, thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload