waar19 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

OutOfMemoryError: bitmap size exceeds VM budget #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Saw some "OutOfMemoryError: bitmap size exceeds VM budget" errors. Found that 
it boiled down to an inner class broadcast listener that is a registered 
BroadcastListener but is never unregistered, so when more Activities are loaded 
on orientation changes the old ones cannot be garbage collected.

I was able to solve it for our use of the jar source with the attached diff's. 
The main OpenStreetMap app might need more done, to make it's own unregister 
calls. And I realize you may want to handle this in an entirely different way :)

Side note: Tracked this down, and some bugs in our own code, using the Eclipse 
Memory Analyzer plugin, which is rather powerful. I hadn't used before, but 
would now be happy to recommend. http://www.eclipse.org/mat/

Original issue reported on code.google.com by bob.hage...@gmail.com on 2 Oct 2010 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
See also issue 94.

Original comment by neilboyd on 2 Oct 2010 at 8:27

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r400.

Original comment by neilboyd on 5 Oct 2010 at 7:21