Ant Build scripts - java.lang.OutOfMemoryError   6 comments

Posted at 9:26 am in Flash/Flex

I seem to find getting a ‘java.lang.OutOfMemoryError’ a fairly common occurance when using ANT to build my flash projects ;( There’s not much docmentations out there and none of the solutions I found on the web fixed the issue for me ;( the code example below did…


<!– IMPORTANT added folk=’true’ to help avoid java.lang.OutOfMemoryError –>
<mxmlc file=”${module.class}”
output=”${module.target}”
keep-generated-actionscript=”${module.generateActionscript}”
debug=”${module.debug}”
actionscript-file-encoding=”UTF-8″
optimize=”true”
fork=”true”
compiler.show-binding-warnings=”false” incremental=”false” strict=”true” headless-server=”${flex.compile.headlessServer}”>
<!– IMPORTANT we need to give process more memory to avoid java.lang.OutOfMemoryError –>
<jvmarg line=”-Xms512m -Xmx700m -XX:MaxPermSize=700m -XX:PermSize=512m” />

Written by paddy on September 14th, 2009

6 Responses to 'Ant Build scripts - java.lang.OutOfMemoryError'

Subscribe to comments with RSS

  1. Give a look at this:
    http://zarkov.bigsource.de/front_content.php

    Saved my life a couple of times…

    Riccardo Bartoli

    14 Sep 09 at 2:00 pm

  2. Thanks Riccardo, Looks interesting. I didn’t see any options to help with the above issue but maybe the wrapper handles it internally?

    paddy

    14 Sep 09 at 4:35 pm

  3. We had the same issue and several others. Finally we decided to just have the ANT script call the compiler instead of used the Flex Ant Tasks.

    Eric Lewis

    14 Sep 09 at 6:24 pm

  4. Thanks Eric, we need to integrate into ‘Hudson’ to build server-side so as far as I know have to use various Ant tasks.

    paddy

    14 Sep 09 at 7:08 pm

  5. Hey Paddy,

    Another solution is to change the Eclipse Ant Settings:

    http://www.rozengain.com/blog/2009/02/03/outofmemory-errorpermgen-space-with-eclipseflex-builder-pluginant/

    The same thing basically :)

    Dennis Ippel

    29 Sep 09 at 5:00 pm

  6. Thanks for posting. This solution worked for me.

    Lach

    18 Mar 10 at 12:36 am

Leave a Reply