11 Replies Latest reply on Sep 20, 2007 8:16 AM by levancho

    Flex 2 Builder Crash

    BaileyBurger Level 1
      Got an error that said workbench has run out of memory and I need to increase heap size. The message window closed before I had a chance to absorb anything else. Before it crashed, builder was responding very slowly.

      My guess is that I've gotten a bit too carried away with the size of the flex project, placing too much code into one .mxml template. Thinking that I need to start breaking stuff down into components?

      Also, not sure what heap size might be. Any insight would be appreciated.



        • 1. Re: Flex 2 Builder Crash
          ntsiii Level 3
          Ok, no particular file should cause a problem, unless it is ridiculously huge (20-30k lines?)

          Let the architecture be dictated by issues of readability and maintainability. If you have say a Viewstack with 6 child views, and those children are 50+ lines long, consider making them components. It will be easier to read, and easier to maintain.

          Here are the settings I use for my FB. They are in the FB install folder in a file called FlexBuilder.ini

          -vmargs
          -Xms512M
          -Xmx512M
          -XX:MinHeapFreeRatio=20
          -XX:MaxPermSize=128m
          -XX:PermSize=128m

          Tracy
          • 2. Re: Flex 2 Builder Crash
            ntsiii Level 3
            Also, if you have multiple projects in the workspace, close the ones you are not using immediately. It only takes seconds to open and close a project and speeds up everything, like compilation.
            Tracy
            • 3. Re: Flex 2 Builder Crash
              BaileyBurger Level 1
              The app so far is under 1000 lines. No other projects opened, and no other apps running on the machine.

              Interesting. I didn't have entries for -XX:MaxPermSize=128m or -XX:PermSize=128m. Xms was set for 128M. Made these changes and will see how it goes.

              Thanks for the suggestions!
              • 4. Re: Flex 2 Builder Crash
                BaileyBurger Level 1
                had to see...

                Flex is still crashing. Building Workspace prompt gets to 33% everytime, then freezes. Happens on every save, not just on Run.

                I understand the use of components, but I'd not be surprised if the main application got to be 1000 lines long even with components. I don't think that should be killing the builder.

                Error message: An out of memory error has occured. It says somthing about adjusting vmarg via command utility, which is what I think you were having me do with above?

                This stinks. Any other suggestions?
                • 5. Re: Flex 2 Builder Crash
                  ntsiii Level 3
                  Something is wrong. If it was me, I'd first re-install FB. then re-apply those settings.

                  Tracy
                  • 6. Re: Flex 2 Builder Crash
                    BaileyBurger Level 1
                    Tracy, thanks so much for sticking with me on this.

                    I did the reinstall and changed settings again. No dice. But figured it out.

                    Everytime I get to a milestone, I'll do a file... save as to rename the mxml file and continue on. My own version control :-). But all these files seem to be clogging up the builder (I had about 35 files in the project folder). I rebuilt the project with just the one mxml file, and have been copying the file out into another folder to save versions. This seems to have solved the problem.

                    If you have suggestions on a better version conrol, let me know. (version que in CS3?) Thanks again!
                    • 7. Re: Flex 2 Builder Crash
                      Mitek17 Level 1
                      How much RAM do you have installed?
                      Our project was just stuffed when the code size reached about 800kB. It was crashing, freezing, compiling for 15 minutes. Installation of the next 1Gb of RAM helped.

                      These Java things will never stop amazing me...

                      Dmitri.
                      • 8. Re: Flex 2 Builder Crash
                        BaileyBurger Level 1
                        Dmitri, I'm running on a laptoap with 1/2 G ram.

                        Since I dumped out all of the extra mxml files, things are running much more smoothly. Close open projects before exit helps as well.

                        I read somewhere, I believe, that best practice is to keep remote object templates (CFCs) in the project folder. I'm wondering after this experience at waht project size builder will start to choke? Also if having the CFCs in the project folder would even matter if builder ignores files with cfc extensions?
                        • 9. Re: Flex 2 Builder Crash
                          RussellMe
                          Can anyone explain the “FlexBuilder.ini” file to me (the vars and values)?

                          Also, the suggested changes (that ntsiii wrote about) – are these things written anywhere (so that I can decide the best options and values for my system).?
                          • 10. Flex 2 Builder Crash
                            levancho Level 3
                            -vmargs - this is flag saying that Java Virtual machin flags are following after this.
                            -Xms512M - Xms specifies minimum size Heap that JVM should allocate and reserve for itself only :) when it is started

                            NOTE: Heap-"ram space"- JVM heap space is the memory area where all objects reside. In addition to objects, the heap can also contain memory reserved for the garbage collector .
                            -Xmx512M - same as "Xms" but this is the max size that it can grow if it becomes bigger than allocated Xms size
                            -XX:MinHeapFreeRatio=how much minimum Heap free space JVM should maintain based on ratio value.

                            -XX:PermSize-space which holds JVM structures and class objects,if you are using a very large number of classes, it is possible to run out of space in "Perm" , and you may need to increase the size of that space.

                            -XX:MaxPermSize - same as PermSize but this is the max sizr that it can grow if it becomes bigger than aloacated PermSize-

                            it is not a good Idiea at all to have -Xmx512M and -Xms512M - same value,
                            it almost makes no difference.
                            its better to give about half of the -Xmx value to -Xms (bigger you can afford ram for Xms better for you ) but make sure OS has anough left (othervise JVM might not even start)
                            • 11. Re: Flex 2 Builder Crash
                              levancho Level 3
                              also you can pass all this arguments to flexbuilder exe (eclipse.exe) easily with shortcut. (windows O.S only) if you have shortcut to flexubuilder
                              right click on it and select properties .
                              in properties dialog in field labeled "target" you can input your parameters (noo need for ini files etc ... :))
                              for example my target has :
                              D:\opt\myeclipe5.5\eclipse\eclipse.exe -vmargs -Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M