10 Replies Latest reply on Aug 2, 2006 1:47 PM by Renaun_Erickson

    Memory leak

    Jim the Knife
      Hi,

      I hate to beat a dead horse, and there certainly have been posts to this effect to date, but Flex Builder stand-alone installation continues to have massive memory leak issues in the release version. If I compile my simple 25K MXML while watching my system resources, FB grabs about 30Mb of memory and never releases it. If I add a space character somewhere and re-compile, it grabs another 30Mb, etc. I saw another post from somebody on the Flex team regarding memory garbage collection, but that doesn't seem to apply to Flex, only to the Flash Player. I am sure this has nothing to do with my code, since everybody at my company has seen the same problem with every application we've created, including samples from help. I've got 2 GB of RAM in my machine, so I can get away w/o restarting FB every 10 minutes, but I'm sure most dev boxes don't have that much RAM!

      I realize that fixing memory leaks is horribly difficult and time-consuming, and that the original problem might be something in Eclipse, but it would be hugely helpful if you could get these issues resolved. Flex 2.0 is a fantastic application - it would be a shame to turn people off of it because of something like this. Should somebody at Adobe need more info from us regarding exact local setup, e.g. operating system, processor type, etc., please send me a private message.

      Thanks, Jim
        • 1. Re: Memory leak
          Level 7
          Hi Jim,

          Actually, the comments about garbage collection apply to Flex Builder as well
          as to Flex. Flex Builder is written entirely in Java.

          So, there aren't any real "leaks" in the sense you are describing; but
          certainly it's true that Flex Builder does use a whole lot of memory, and we
          should spend some time working on reducing our memory usage.

          Thanks for the feedback. - Mike
          • 2. Re: Memory leak
            Ray Greenwell
            Mike: it's still possible to have memory leaks in Java.

            Jim: it's possible that nothing is leaking at all. Java is not required to ever run the garbage collector, and maybe your 2GB of RAM is giving it plenty of stretching room. On my half-gig windows machine the java process also eats a load of RAM the first time I compile, but after a few times it tops out at 194MB.
            • 3. Re: Memory leak
              Level 7
              > Mike: it's still possible to have memory leaks in Java.

              Yes, I know, but for one thing, Jim was under the impression that Flex Builder
              was not doing garbage collection, and I wanted to correct that impression; and
              secondly, we know from analysis that the memory consumption issues in Flex
              Builder are not caused by leaks, just by using more memory than we should.

              Thanks - Mike
              • 4. Re: Memory leak
                Level 7
                Semantic hair-splitting aside, FB2 suffers from unbounded memory
                consumption - in products that I've developed, this was labelled a "memory
                leak".

                I provided the following to Adobe as part of feedback for the GMC6 build.:

                The test below exposed a memory loss of about 70 MB over 2 hours.

                Eclipse plug-in, javaw started with -Xmx768M
                Test:
                1.. Open editor on Explore.mxml. Switch to Design view and back to
                source view.
                2.. Compile older revision 191 of Flex source files, then compile latest
                revision. Note Mem Usage value. Repeat step 2.
                Windows Task Manager Mem Usage
                [MB] Notes
                516
                519
                537
                539
                549
                560
                561
                565
                566
                567
                568
                568
                569
                569
                570
                572
                573 Error: Couldn't get content type
                573
                575
                575
                578
                580
                584
                585
                587

                --
                J�rgen Failenschmid


                • 5. Re: Memory leak
                  dishmael Level 1
                  Just wanted to add to the growing list of users experiencing memory issues. I have 2GB of memory on my dev box but after about two or three hours I run out of memory and the builder crashes. After the builder crashes, the system memory jumps back up and I can re-launch the builder app again (I save very often so its more an annoyance than anything else). This repeats several times in the course of a development session. The few times I've watched my system resources, I can see the javaw process consuming large quantities of memory (~256-512MB at one point). Anyway, just wanted to add my input since I'm affected as well.
                  • 6. Re: Memory leak
                    Renaun_Erickson Level 1
                    You can try using different JVM with the Flex Builder to see if it helps.

                    http://renaun.com/blog/2006/06/27/50/
                    (prefered method in the comments)

                    Sun's Java HotSpot might have some memory leaks try using IBM's VM or JRockit and see if it helps the Flex Builder memory issues.
                    • 7. Re: Memory leak
                      Level 7
                      Do you have a source for your claim of a memory leak in the Sun VM? Which
                      version(s) of the JRE/JDK?

                      --
                      J�rgen Failenschmid


                      • 8. Re: Memory leak
                        Renaun_Erickson Level 1
                        Sorry about hte Sun memory leak comment, I shouldn't claim anything but there is a lot of chatter since Flex about different issues. Either way if you are having problems with compiling it doesn't hurt to try different VM arguments or different JVM's.

                        http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config=flexcoders_yah oogroups_com&restrict=&exclude=&words=memory+leak

                        Other known issues:
                        http://www.adobe.com/support/documentation/en/flex/2/releasenotes_flex2_fb.html
                        Compiler is slow with Sun JRE 1.4.2_10 - There is a known issue with Sun JRE 1.4.2_10 with unzipping that causes the compiler to be extremely slow. This issue is not present in Sun JRE 1.4.2_09 or Sun JRE 1.4.2_11.

                        Now on the other hand. JVM's in general eat up Ram normally and don't give it back even if they are doing garbage collection. You can set Xmx and Xms settings to limit the start and max ram the JVM should use.
                        • 9. Re: Memory leak
                          leotemp Level 1
                          Im using XP pro service pack2 and 1GB ram, I will admit then when i launch FB and the first time i compile it eats about all my memmory but after that javaw grabs about 220MB and thats about it, i leave my maching on for days, play games and movies and generally abuse my poor machine but no problems running out of ram.
                          • 10. Re: Memory leak
                            Renaun_Erickson Level 1
                            i use Sun's JVM and Jrockits with 2 eclipses (Flex 1.5 and Flex2), ColdFusion and Tomcat. I have 2 GB of ram and I develop on my box all day at work with no problems too. But I have had servers that have issues with different JVM and their settings.