Posts Tagged ‘Memory’

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…)

MXML Components VS ActionScript Components–Is the Memory Usage of Components Built with MXML tag Bigger than that of Components Built in ActionScript

System-Memory-256x256 I am working on an application which contains many components. I have been puzzled by a problem for a long time: Is the memory usage of components built with mxml tag bigger than that of components built in actionScript? I did a simple experiment below to find the truth.

Preparation: use the codes below to add new mxml component:

  1. <mx :Button/> <mx :TextInput/>
  2. <mx :Button/> <mx :TextInput/>
  3. <mx :Button/> <mx :TextInput/>

(more…)