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:
- java.lang.OutOfMemoryError: Java heap space
- at java.util.HashMap.resize(Unknown Source)
- 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:
- -Xms define the minimum usage of memory by JRE
- -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.
With Flex Builder, point to the menu “Windows” at the top and open the “Preferences” dialog.
Expand the left tree as this: Java->Installed JREs. Then select the JRE being used and click Edit to open the “Edit JRE” dialog.
Then, set the Default VM arguments as “-Xmx1024m” to enlarge the memory usage limitation.

August 6th, 2008
Ntt.cc 








Posted in
Tags: 
RSS Feed
Email Feed
[...] public links >> xms Set the ANT_OPT for flex ant tasks to avoid the error “out of memory” threw by Flex Builder when… Saved by MrEARSking on Thu 06-11-2008 XMS FTW Saved by onaboy on Sun 02-11-2008 NE YO Lawyer [...]
I have been searched a solution for 3 days.
Thank you very much!