12 Replies Latest reply on Nov 20, 2012 12:46 PM by yajmire

    Flash Builder 4.5 Java Heap Space Error

    MikisMM Level 2

      Hello everyone,


      I've downloaded Flash Builder 4.5 trial a few days ago. Let me first tell that I like the new features a lot and they help to speed up the development process noticably. I thank Adobe for that very much.


      However I did not notice any performance boost over the Flash Buidler 4. Even worse, the 4.5 version seems to run much slower and use more memory than Flash Builder 4. I constantly keep getting Java Heap Space errors and needles to say, the tool just crashes and I have to restart it.


      Here how my experience working with the new version looks like. I start the Flash Builder 4.5 which has my current project open (for the record, I still use Flex 4.1, and the project includes roughly 300+ classes and 30000+ lines of code (AS and MXML)). At the beggining everything works fine and pretty fast. UI, code completion, snippets and all other good stuff works pretty fast. However, after each build, FlashBuilder.exe process eats up from 50 to 100 megabytes of memory and does not seem to release it or reuse it. So after a 5 or 10 builds it already appears to be using over 1 GB of RAM. At that point the editor becomes sloppy - it can't keep up with my typing, code completion popups takes a few seconds to show up. And a few more builds - the Flash Builder freezes and after a minute or two I get Java Heap Space error.


      I've tried increased the JRE heap space used by the Flash Builder (flashbuilder.ini, flashbuilderc.ini, eclipse.ini) to -Xms512m -Xmx1024m as well as permanent generation heap space to -XX:MaxPermSize=512m -XX:PermSize=256m and the mxml compiler (jvm.config) to -Xms384m -Xmx768m. However this did not solve the problem. Maybe just postponed it a bit.


      Am I the only one observing such behaviour of Flash Builder 4.5? Does any one have any other ideas how to fix this? (by the way, I work on 64bit machine with Widnows Server 2008R2, 4GB of RAM and 2.66 GHz Intel Core 2 Duo).


      Thanks in advance.



        • 1. Re: Flash Builder 4.5 Java Heap Space Error

          I'm seeing nearly the same thing.  I also have a very large set of projects similar to what you are describing and I do have Java Heap Space errors (The details show an error of "java.lang.OutOfMemoryError: unable to create new native thread" occurring for me)


          I had similar issues, although they are more frequent in the 4.5 builder, in the 4.1 builder.  In 4.1 builder, I didn't get the exact same detailed error regarding threads.


          I did install my flash builder into a clean instance of eclipse 3.6.2 vs using the standalone install.  That shouldn't make a difference though.  In 4.1, I tried he standalone install and saw the same issues I saw in the plugin version.


          I'm also using the 4.1 SDK in Flash Builder 4.5 (It appears that is what you are doing).  I've been attributing the crashes to the following bug in the 4.1 SDK, although I have applied the files in the bug report and still have the problem.  I'm hoping when I'm able to switch to the 4.5 SDK it may help.  (I can't switch yet because from what I can tell, it requires 10.2 Flash Player and my company is currently only on 10.0)


          The Bug Report I'm referring to is: https://bugs.adobe.com/jira/browse/SDK-26366


          I've bumped up all of the memory settings you've referred to and it helps the environment run longer, but it still eventually crashes.  One thing I definately do is make sure that the "Build Automatically" is unchecked.


          The machine I'm running on is an Intel 2600K with 16GB of memory running Windows 7 64-bit, so I don't think hardware is the issue.


          No real answer, but your not alone in having similar issues.



          • 2. Re: Flash Builder 4.5 Java Heap Space Error
            MikisMM Level 2

            Thanks for the reply, Jon. Its always encouraging to know that I'm not alone in this.

            And yes. Flash Builder 4 does not have this problem or maybe its not that obvious. I hope that after migrating to Flex 4.5 (don't have time for this right now and just making everything compile does not seem to solve all incompatibility problems) this annoyance will be gone.


            Thanks again.



            • 3. Re: Flash Builder 4.5 Java Heap Space Error



              I have got a Java Heap Space Error too, working with Flash Builder 4.5 and SDK 4.1.

              Another stupid thing with this release, is that it not supports Design View with 4.1 projects.


              I need to use FB 4.5 because it includes a new version of fiber library that correct this bug https://bugs.adobe.com/jira/browse/FB-29788

              I have made the upgrade of my project to SDK 4.5, and discovered this bug https://bugs.adobe.com/jira/browse/FLEXDMV-2606.

              Then I rollback to SDK 4.1, and now I can't use Design View.

              I'm quite disapointed...

              • 4. Re: Flash Builder 4.5 Java Heap Space Error

                I have this same issue with Flash Builder 4.0 (build 272416) compiling with Flex 4.1. My AIR project is pretty big with over 50 megs of embeded media (img, snd, etc). I've also upped all of the .ini files but it only buys me a little extra time. At this point, I'm restarting the IDE after every new asset addition or major code update.


                I've added a bit to a JIRA bug but I'm not sure that this is exactly the issue that I'm running into: http://bugs.adobe.com/jira/browse/FB-21556


                [Running on Mac OSX V 10.6.7; 2.53 GHz Intel Core 2 Duo; 4 GB DDR3]

                • 5. Re: Flash Builder 4.5 Java Heap Space Error


                  seems I have same problem  - a minor change or embedding of any media causes crash and burn on win7pro64b hexacore westmere


                  Tried rolling back flashplayer, upping heap memory no joy.

                  • 6. Re: Flash Builder 4.5 Java Heap Space Error
                    mrdweedles Level 1

                    Adobe inspected my project and came back with the following:


                    I looked at your project. The problem there is the amount of embedded assets. I understand that since the app you are building is a game, it makes sense to have these many. For a normal compile, your project needs heap memory of around 600M - 800M. Between incremental compiles, the limit is being easily hit. [....]

                    The key bug here: the compiler needs to be smarter about embedded assets. I'll file a separate bug for that and send you a workaround in the meantime (move all embedded assets to a library project and disable global SWC cache).


                    I made the changes that were recommended but I'm still getting the Java Heap Error when exporting a release build. It's better though!


                    As an aside, I'm able to restart the IDE and then (most of the time) I'll be able to get a clean build.

                    • 7. Re: Flash Builder 4.5 Java Heap Space Error
                      Chuck Simpson

                      I found the reason for the OutOfMemory errors I was getting in Flash  Builder 4.5. It may seem counter-intuitive but, I resolved the issue by  reducing the -Xmx JVM argument from 1024m to 768m. I noticed that the  Flash Builder Java process kept crashing when the private bytes size was  around 1.3GB. The maximum process size for a Windows 32 bit process is  the same value. So I believe having a large Java heap causes the Windows  process to operate at a point where the Windows process allocates  enough memory to prevent the JVM from allocating the heap space it  needs.

                      After reducing the -Xmx argument value I have not had any OOM errors.

                      When is Adobe going to release a 64bit Flash Builder?

                      • 8. Re: Flash Builder 4.5 Java Heap Space Error
                        MikisMM Level 2

                        Hi, Chuck. Im glad to hear that you found a solution for your problem. Unfortunatelly, it didn't help me at all. The 768 MB limit only made things worse.

                        • 9. Re: Flash Builder 4.5 Java Heap Space Error
                          Chuck Simpson Level 1

                          Sorry, to hear that. I am sending the command line and .ini settings I use.

                          Hope this helps you.


                          Here is the command line I am using to launch Flash Builder:


                          "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\FlashBuilder.exe" -vm

                          "%JAVA6_HOME%\bin\javaw.exe" -vmargs -Xms256m -Xmx768m -XX:PermSize=256m

                          -XX:MaxPermSize=384m -XX:UseParNewGC  -XX:CMSPermGenSweepingEnabled



                          Here are the settings in my FlashBuilder.ini file:













                          C:\Program Files (x86)\Java\jre6\bin\javaw.exe











                          Chuck Simpson

                          • 10. Re: Flash Builder 4.5 Java Heap Space Error

                            I am having the same problem as thread starter. I use Flash Builder 4.0.1 with Flex SDK 4.1 (with Flex 3 compatibility mode). My project is not nearly as big as the others here, the project folder contains 800 files and it has a total size of about 50 mb. Not a lot of embeded assets either (about 8MB).

                            • 11. Re: Flash Builder 4.5 Java Heap Space Error
                              Denis Maslov Level 1

                              Chuck, many thanks! Your settings works for me perfect. You save me a lot of nerves.

                              Flash Builder 4.6, Win7 x64, 8Gb RAM

                              • 12. Re: Flash Builder 4.5 Java Heap Space Error

                                I am also having same issue. I have Flash Builder 4.5 premium, Win7 x64, 4gb ram. I copied ini file as chuck said but still does not help. I want to use sdk 3.6.

                                How do I resolve this.


                                Thanks in advance.



                                yogesh Ajmire