Search code examples
androidout-of-memorycocos2d-android

Cocos2D android java.lang.OutOfMemoryError: bitmap size exceeds VM budget


i have 10 ~34KB images of 960x640 size and im trying to use all of them in Cocos2D. I run the game on a Samsung galaxy tab 10.1 and it runs fine, but when i try to use it on a motorola droid X it throws this out of memory error. Ive looked around but have been unable to find anything helpful. Im using the latest version of Cocos2D from the SVN.

This small game is run from a larger android app, but the 400KB of images shouldnt destroy the memory right?

i thought the VM budget was large enough to easily use these, or do the images get significantly larger when in memory?

UPDATE: I have tried preloading everything but that still has the problem on the first load of the game. does Cocos2D/Android really not support several images of so many pixels?


Solution

  • hey i also faced this problems many times actually this error happens when your images are too big ....to reduce this you have to finish your images , i mean you have to make you image gallery or what ever you used you have to clear them , i tried this and it worked for me , because some times when you run your application with the same for 4-5 times you will also face forse close......