Posts Tagged ‘Ant’

Set the ANT_OPT for flex ant tasks to avoid the error “out of memory” threw by Flex Builder when building a huge project

memory Problem Summary: When I compile a project including thousands MXML and AS files with Flex Ant, I got an error message as below displayed in the Console panel of Flex Builder:

  1. java.lang.OutOfMemoryError: Java heap space
  2. at java.util.HashMap.resize(Unknown Source)
  3. at java.util.HashMap.addEntry(Unknown Source)

It seems that the memory usage of my JRE reaches its limitation — as we know, Flex Builder is running in JRE. Here is a simple way to solve this problem. It‘s just changing the preferences settings of Flex Builder.

Solution Summary: There are two useful arguments of JRE to control the memory usage:

  1. -Xms define the minimum usage of memory by JRE
  2. -Xmx define the maximum usage of memory by JRE

I just set –Xmx to 1024m to satisfy the usage of compiling such huge Flex project.

(more…)

automatically create an Ant build file from your Flex Builder project with Flex2Ant

bass-48x48 With flex2ant you have the ability to add the Adobe Flex 2 SDK command line compiler (mxmlc) to your Eclipse installation. By installing flex2ant you add a specific Ant task to the Ant installation that is part of the Eclipse IDE, therefore making this task visible to the Eclipse environment.

(more…)