Posted in Adobe, AIR, Flash, Flex
08/12 2010

Flash Builder 4 – Java Heap Space Issues

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=false

3. Increase the memory size to a larger value like the following example:

java.args=-Xmx512m -Dsun.io.useCanonCaches=false

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

This Post tags: , , ,

 

USER COMMENTS

Track comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.

  1. 08/12 2010

    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.

  2. 08/12 2010

    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… :D

  3. 08/12 2010

    great article. greetings from romania!

  4. Andrew
    08/12 2010

    Great article man, this did the trick for me!

  5. Uabkamil
    08/12 2010

    This was perfect and simple. Great straightforward assistance.

  6. 08/12 2010

    It works. Great.

  7. Celmar
    08/12 2010

    Thanks a lot !!
    I updated flashbuilder.ini but have the same problem.
    Now it’s very confortable.

  8. 08/12 2010

    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

  9. Dany Dhondt
    08/12 2010

    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

  10. 08/12 2010

    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…

  11. 08/12 2010

    [...] Technophi : Flash Builder 4 – Java Heap Space Issues [...]

  12. Jay Wood
    08/12 2010

    Thank you for the excellent advice… this saved me a lot of frustration.

  13. 08/12 2010

    [...] 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 [...]

  14. 08/12 2010

    Thank you. Resolved.

  15. Ken
    08/12 2010

    check this out you have to make changes to flashbuilder.ini

    http://forums.adobe.com/thread/629986

  16. Vinz
    08/12 2010

    Thank you!
    Work also, with Flash Catalyst on a Mac.
    -Xmx1024

Get Adobe Flash playerPlugin by wpburn.com wordpress themes