Java Heap Space with Code Embedding


(Wellarrived) #1

Hi guys,

I’m facing a huge problem when trying to use images in my game. I’m using the “Generate Embbed code” technique, but i got an error when trying to import several images. (Like 5 images, each equal to 10MB, with huge resolution). This error is : Java Heap Space.

I don’t know what is happening, do you guys know a solution ?


(Zachary Lewis) #2

Is this an issue with FlashPunk or with your IDE? If it is the latter, what IDE are you using?


(Jacob Albano) #3

It’s a Flex error. See here:


Parsing TILED XML in flashpunk, can't seem to add bitmaps and shapes?
(Ultima2876) #4

You could try splitting them into smaller images. Such as into quarters, then creating a graphiclist of Images instead of one big Image.


(Jacob Albano) #5

That actually makes me think…I had assumed the error had to do with the compiler running out of memory when compressing assets, but maybe it’s because the images are too large? A BitmapData in Flash can only be 8,191 pixels on any side.


(Ultima2876) #6

It is possibly related to both; the compiler chokes when working with extremely large individual assets but not so much with many smaller ones (you can have 50mb of small assets without problems).

If it were entirely to do with the BitmapData limitation it would probably show up as a runtime issue, I’d think.