Java Heap Space Error

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Just finished a game for Flash and get this on compile:

    Loading configuration file C:\Program Files (x86)\Multimedia Fusion Developer 2\Data\Runtime\Flash\Flex\frameworks\flex-config.xml
    Error: Java heap space

    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown Source)
    at java.io.ByteArrayOutputStream.write(Unknown Source)
    at flash.swf.RandomAccessBuffer.write(RandomAccessBuffer.java:90)
    at flash.swf.SwfEncoder.writeUI16(SwfEncoder.java:59)
    at flash.swf.TagEncoder.encodeTagHeader(TagEncoder.java:310)
    at flash.swf.TagEncoder.encodeTag(TagEncoder.java:254)
    at flash.swf.TagEncoder.exportAssets(TagEncoder.java:1929)
    at flash.swf.tags.ExportAssets.visit(ExportAssets.java:38)
    at flash.swf.MovieEncoder.export(MovieEncoder.java:128)
    at flex2.compiler.API.encode(API.java:4077)
    at flex2.tools.Compiler.mxmlc(Compiler.java:270)
    at flex2.tools.Compiler.main(Compiler.java:53)


    ...help!!..

    Thanks
    Haz

  • yes latest Java - but I think I know what it is...

    As there is no way to use movies in Flash games which are not connected to the internet (Flash and FLV's players CAN ONLY be used with ONLINE files via a URL because you cannot access the local file system, everything must be embedded in the final SWF) - I have a work around which is to render MOV files as an animated gif. Using the normal Active Object, it is then possible to load the gif as a series of images which will then embed in a Flash game (don't use 'box mode' - it crashes - just import as animation)

    Problem is - it's not that robust because the number of frames (several hundred) mean the Active Object takes up tens of MB. Usually its ok and works, but there is obviously a limit.

    I just added one of these and got the above error on compile. If I remove that offending Object, all is fine and it will write the SWF normally. I just wonder if there is a way to increase the heap size or memory allocation for the SWF exporter to stop getting the export error?

  • Locate the file : jvm.config in your run\data\runtime\flash\flex\bin directory, and open it with a text editor.
    Find the line "java.args=-Xmx384m -Dsun.io.useCanonCaches=false" (<--This may be different)
    And change it to 1024m or 2048m.

    _____________________________________________
    Please login to see this link. -Need extensions? Send me a PM.-

  • Okay, I figured it out.

    You need to change:

    "java.args=-Xmx384m -Dsun.io.useCanonCaches=false"

    to

    "java.args=-Xmx2048m -Dsun.io.useCanonCaches=false'

    However, I should mention that I tried 2048 first, and it didn't work, probably because my computer is too slow, but when I switched to 1024, it was fine.

    Please login to see this link.

    Edited 3 times, last by redpandagames (May 10, 2013 at 9:00 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!