If you ever experience a message like “Error: Java Heap Space” when building, cleaning or generating a bin-release for a project in Flash Builder 4, try the following as a remedy:
1. Open the following files:
a) /install_dir/sdks/3.5.0/bin/jvm.config
b) /install_dir/sdks/4.0.0/bin/jvm.config
2. Locate the following line found under # Arguments to VM:
java.args=-Xmx384m -Dsun.io.useCanonCaches=false3. Increase the memory size to a larger value like the following example:
java.args=-Xmx512m -Dsun.io.useCanonCaches=falseThe max you set this value to is determined by your available memory along with some workflow considerations but this should alleviate your heap issues and smooth out Flash Builder compilations considerably…



Had similar issues compiling swf 200 Mb large.
On the mac, you will have to edit the mxmc script to allow more memory. I needed like 2048…
Another tips, you can also get memory issues with eclipse (or flash builder) and the launchers. I didn’t find where to increase the memory for those launchers. Compiling with Ant solved the problem.
That’s an excellent point Romu. For FB memory issues, you’d need to modify your INI file for FB. On a Mac, you can find that by going to your Applications folder then:
1. Right click on Adobe Flash Builder 4.app or Eclipse.app, Show Package Contents
2. Open Contents > MacOS > Adobe Flash Builder 4.ini
Once you have that file open you want to look for the line that starts with -Xmx and boost that value. Thanks for the reminder…
great article. greetings from romania!
Great article man, this did the trick for me!
This was perfect and simple. Great straightforward assistance.
It works. Great.
Thanks a lot !!
I updated flashbuilder.ini but have the same problem.
Now it’s very confortable.
Thanks man, this didn’t resolve my issue alone. After some digging I had to add the same line into
window > preferences > Java > Installed JRE’s > [The checked option] > Edit >
and add the line below into “Default VM Arguments” :
-Xms512m -Xmx1024m
Hi! Thanks for this info! I run into a problem though:
Increasing the memory in the jvm.config files was no problem.
When I try to increase the value of Xmx, I get a ‘JVM terminated’ error when I launch FB. Any ideas? thx. Dany
Hey Dany,
Does the launch error disappear if you revert that value? If so, then it may be fixable by a marginal value increase. Other than that, there should be more detail in the error logs…
[...] Technophi : Flash Builder 4 – Java Heap Space Issues [...]
Thank you for the excellent advice… this saved me a lot of frustration.
[...] going to need enough heap space to build this uber swc, so follow Hasan Otuome’s instructions for that. Don’t be stingy here: I gave myself 4096M. You’re not going to accomplish [...]
Thank you. Resolved.
check this out you have to make changes to flashbuilder.ini
http://forums.adobe.com/thread/629986
Thank you!
Work also, with Flash Catalyst on a Mac.
-Xmx1024