Too many bitmaps causing an out of memory error!

Mickster

Active Member
Licensed User
Longtime User
Hey guys,

So I've developed an app with 5 different activity modules representing 5 different 'pages'. The app uses a ton of .png images for graphics and I have hit an 'out of memory' error. I've found a few posts discussing this error on the forum, but so far I haven't figured out how I can free up the memory.

The application doesn't need all the images loaded at the same time, so I've been looking for a way to remove them from memory when the user jumps between pages.

To apply the graphics, I've been using the .setbackgroundimage(loadbitmap... routine.

Any ideas? Am I using an inefficient command for loading images? Is there a way to remove them from memory without destroying the objects they're attached to (I need to preserve the objects)?

Thanks.
 

Mickster

Active Member
Licensed User
Longtime User
Thanks for the help.

I may not have a real solution but at least I know I'm not missing anything here.
 
Upvote 0

eps

Expert
Licensed User
Longtime User

That part of the process doesn't free the memory, but indicates that it can be re-used. If the JVM will encounter an out of memory exception it will see if it can free up some memory to avoid that occuring.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…