1

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?

1 Answer 1

0

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......

6
  • Yea, i thought that the CCTextureCache was able tot take care of such things? the way i see that written is that it doesnt reload the textures but maintains a cached version of them. im trying to use those cached versions multiple times, should i just preload all of the textures and then set the sprites to use that texture? will that solve the problem?
    – Intrivix
    Jun 1, 2012 at 16:10
  • well i have a temporary fix of making the images half size and scaling up, but that doesnt look good so i would prefer having an actual solution =/
    – Intrivix
    Jun 1, 2012 at 18:31
  • well, to fit with the requirement of having a bit more animation, i tried adding another 7 half size images, but now the error persists... any ideas why Cocos2D has such a terrible limit on the amount of memory you can use?
    – Intrivix
    Jun 1, 2012 at 22:33
  • actually what i suggest that u have to use the bitmap size images or try to use the thumbnail image this is what i have done .......u have to use little bit lower images so that u might not get this error Jun 2, 2012 at 5:10
  • Thanks, ive avoided the problem by using those smaller images, but it isnt an ideal solution... Preferably android/opengl/cocos2d would support these larger images... Ill just deal with it for now...
    – Intrivix
    Jun 5, 2012 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.