Android Question Memory problem

Facilauto Juan

Member
Licensed User
Hello there!

I have an app that's giving me some memory problems. In low ram devices, it loads the images at low resolution, and some crashes could be happening for the "out of memory" thing too.

My question is: how do you handle this kind of problems? How can we developers avoid this out of memory problems?

Thanks for your answers and your time.
 

eps

Well-Known Member
Licensed User
Are you using BitmapSample? Have you defined the Bitmap Globally, as this can be reused, as opposed to keeping on grabbing memory allocation if used locally.

How big, in pixel terms are the images?

I've put in place a recycle and a try, if my image loading fails, then it loads a smaller (both pixel and memory size) version of the images.. This seems to keep things limited to a sensible level.

Are you using B4A ver 2.7?
 

eps

Well-Known Member
Licensed User
Yes, but you can't grab all of it! You can try increasing the heapsize, but that just prolongs the inevitable..

I've installed the App Memory Usage and then watched how much memory my Apps were using.

What is the code or part of the code doing? Are you recycling your memory?
 
Top