Monday 15 February 2010

memory - java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android -


I have developed an application that uses many images on Android.

The app runs once, information on the screen ( layout , list view , textviews , ImageViews , etc.) and reads user information.

There is no animation, no special effects or anything that can fill up memory Sometimes the designers can change some are Android resources and some files are saved in a folder in the SDCard.

Then the user exits ( onDestroy method executes and the app resides in memory by VM) and then user enters again at some point

Whenever the user enters the app, I can see the maximum number of memory as long as the user gets java.lang.OutOfMemoryError .

What is the best / correct way to handle multiple images?

Should I put them in steady ways so that they do not load at all times? Do I have to clean layout or images specifically in layout?

It seems as if you have a memory leak, the problem is not handling many pictures, that is When your activity is destroyed, then your images are not being distributed.

It is difficult to say why it is without looking at your code, however, there are some tips in this article that can help:

Special appearance From, using the stable variable is likely to make things worse, you may not need to add code that removes callback while redressing your application - but then, there is not enough information to make sure is.


No comments:

Post a Comment