User Tag List

Results 1 to 6 of 6

Thread: Java Heap Space Error

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jan 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Java Heap Space Error

    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(RandomAccessBuf fer.java:90)
    at flash.swf.SwfEncoder.writeUI16(SwfEncoder.java:59)
    at flash.swf.TagEncoder.encodeTagHeader(TagEncoder.ja va:310)
    at flash.swf.TagEncoder.encodeTag(TagEncoder.java:254 )
    at flash.swf.TagEncoder.exportAssets(TagEncoder.java: 1929)
    at flash.swf.tags.ExportAssets.visit(ExportAssets.jav a:38)
    at flash.swf.MovieEncoder.export(MovieEncoder.java:12 8)
    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

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,729
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Do you have the latest Java installed?

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jan 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jan 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Amazing - thank you so much. It worked.

    Cheers Stephen!

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    redpandagames's Avatar
    Join Date
    Dec 2011
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

Similar Threads

  1. please correct java heap in next swf update
    By Drcooper in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 1st June 2011, 06:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •