Wednesday, December 1, 2010

Flash Builder 4 "Java heap space" error

While attempting to compile and run a Flash Builder 4 project recently, I was receiving an error titled "Java heap space" with no additional information given. Some searching revealed that the IDE was running out of memory and a configuration file needed to be tweaked to give it more. Several forum posts suggested altering the jvm.config file in the /bin directory for the appropriate SDK such that the line:

java.args=-Xmx384m

has a higher numerical value. From what I understand, this is an argument passed in when opening the IDE that specifies an upper limit on the memory that the Java compiler is allowed to use. Unfortunately, changing this line did not fix the error. After some more searching, I found a forum post from an Adobe employee that suggested changing the eclipse.ini file in my Eclipse install directory so that the line:

-Xmx384m

has a higher value. I bumped this up to 768 and the error vanished. This is the same argument as the one in the jvm.config file but I suspect that the jvm.config argument was being ignored in favor of the eclipse.ini one. I do recall choosing to install Flash Builder 4 as a plug-in to Eclipse rather than a stand-alone application, so that may be the reason it's favoring eclipse.ini.

No comments:

Post a Comment