7 Replies Latest reply on May 30, 2006 11:57 AM by inactiveforumnotifier

    Memory Leak - is there a solution?

    EricNY523
      I'm going through an on-going battle with Flash and a memory leak. I can't seem to find a definitive answer... is there still a memory leak in Flash Player 8.0.22? If so... what are the work around to having a stable application that can run for an extended period of time (more than 24 hours, if needed).

      My application is a "slideshow" that plays various SWF and flash animations in sequence. Each animation is different, however it uses the same scripts and code accross the board. Then I have the code in my "player" ... when the player has nothing to play... the memory stays static, however when my animations come through, it gradually increases.

      The solutions I've come accross in the boards talk about deleting my objects after I'm finished using them. When each animation completes it calls a function that clears out any objects that haven't been already deleted. I don't have any intervals going either... Minimize doesn't seem to clear up the memory either, as previously suggested.

      The application is wrapped in a ZINC executable, however the memory leak occurs as a native SWF as well. Any help would be much appreciated.

      Thank-You,
      -Eric
        • 1. Re: Memory Leak - is there a solution?
          Level 7
          Be sure if you are deleting objects all references to them are also cleared.

          If you have a slideshow, a common approach is to load each slide as an
          external swf into the same MovieClip. Is that your case?

          Are you doing any object generation via code such as createEmptyMovieClip or
          createTextField or other types of components or classes where their names
          are generated via code? If so be sure that you are not endlessly creating
          new objects.

          --
          Lon Hosford
          www.lonhosford.com
          May many happy bits flow your way!
          "EricNY523" <webforumsuser@macromedia.com> wrote in message
          news:e2tdph$sq0$1@forums.macromedia.com...
          I'm going through an on-going battle with Flash and a memory leak. I can't
          seem
          to find a definitive answer... is there still a memory leak in Flash Player
          8.0.22? If so... what are the work around to having a stable application
          that
          can run for an extended period of time (more than 24 hours, if needed).

          My application is a "slideshow" that plays various SWF and flash animations
          in
          sequence. Each animation is different, however it uses the same scripts and
          code accross the board. Then I have the code in my "player" ... when the
          player
          has nothing to play... the memory stays static, however when my animations
          come
          through, it gradually increases.

          The solutions I've come accross in the boards talk about deleting my
          objects
          after I'm finished using them. When each animation completes it calls a
          function that clears out any objects that haven't been already deleted. I
          don't
          have any intervals going either... Minimize doesn't seem to clear up the
          memory
          either, as previously suggested.

          The application is wrapped in a ZINC executable, however the memory leak
          occurs as a native SWF as well. Any help would be much appreciated.

          Thank-You,
          -Eric


          • 2. Memory Leak - is there a solution?
            EricNY523 Level 1
            Thank-you for your response. I'm using the approach you specified, I've been loading a new SWF into the same movie clip. After each clip completes, I have a function in the "player" that removes the clip, and then re-creates it (using createEmptyMovieClip) to clear things out.

            I'm am creating new objects on the fly (textFields and MovieClips)- with unique names. Within each SWF file, I have several instaces that I create each. However, I thought these were removed when the clip is removed? is this incorrect?

            As far as I know, I'm deleting all objects- maybe there's something more I can do?

            EDIT: Actually, I forgot... I changed my methods, so I'm attaching movieclips from the library, with textfields inside the movie clips. Should I be removing these clips when they're done? or are they removed when the parent clip is removed?

            Thank-you for your continued help.

            • 3. Re: Memory Leak - is there a solution?
              Level 7
              >>I'm using the approach you specified, I've been loading a new SWF into
              the same movie clip
              >>After each clip completes, I have a function in the "player" that removes
              >>the clip,
              >> and then re-creates it (using createEmptyMovieClip) to clear things out.
              By definition the MovieClip.loadMovie method or the variation
              MovieClipLoader.loadClip deletes all references to the content in the
              "container/loader" MovieClip. So there is really no need to delete the empty
              "container/loader" clip and recreate. I know I would not bother.

              >>I'm am creating new objects on the fly (textFields and MovieClips)- with
              >>unique names. Within each SWF file, I have several instaces that I create
              >>each.
              >>However, I thought these were removed when the clip is removed? is this
              >>incorrect?
              As long as you are creating them inside the "container/loader" movieclip you
              use to load them.

              A sometimes painful way to verify is to use Control->Test Movie and then use
              the Debug->List Objects or List Variables and search for an object you know
              is to be deleted. As well as a trace statement. Also these should provide
              you with any potential over generation of objects in your code you have
              missed.


              --
              Lon Hosford
              www.lonhosford.com
              May many happy bits flow your way!
              "EricNY523" <webforumsuser@macromedia.com> wrote in message
              news:e35mb6$k49$1@forums.macromedia.com...
              Thank-you for your response. I'm using the approach you specified, I've been
              loading a new SWF into the same movie clip. After each clip completes, I
              have a
              function in the "player" that removes the clip, and then re-creates it
              (using
              createEmptyMovieClip) to clear things out.

              I'm am creating new objects on the fly (textFields and MovieClips)- with
              unique names. Within each SWF file, I have several instaces that I create
              each.
              However, I thought these were removed when the clip is removed? is this
              incorrect?

              As far as I know, I'm deleting all objects- maybe there's something more I
              can
              do?

              Thank-you for your continued help.


              • 4. Re: Memory Leak - is there a solution?
                EricNY523 Level 1
                Thanks for the suggestions... using the debug window, and list variables/objects, at the end of each one of my "slides", the only objects left are the ones on stage, not placed with attach or loadMovie. In transition from one slide to the next, there are no variables listed to be in the container clip for the slides... however there is still a small leak (over the course of 12 hours, my movie increases virtual memory by about ~75 MB) ... any other suggestions would be great, however until I find the problem ... my workaround is having teh application automatically quit and restart itself.

                • 5. Re: Memory Leak - is there a solution?
                  Level 7
                  Not sure were you should go now. But perhaps you want to start a new top
                  thread (they can get stale) to see if you get other takers and perhaps
                  suggest how you would report the issue to Adobe for consideration.

                  --
                  Lon Hosford
                  www.lonhosford.com
                  May many happy bits flow your way!
                  "EricNY523" <webforumsuser@macromedia.com> wrote in message
                  news:e38asm$375$1@forums.macromedia.com...
                  Thanks for the suggestions... using the debug window, and list
                  variables/objects, at the end of each one of my "slides", the only objects
                  left
                  are the ones on stage, not placed with attach or loadMovie. In transition
                  from
                  one slide to the next, there are no variables listed to be in the container
                  clip for the slides... however there is still a small leak (over the course
                  of
                  12 hours, my movie increases virtual memory by about ~75 MB) ... any other
                  suggestions would be great, however until I find the problem ... my
                  workaround
                  is having teh application automatically quit and restart itself.


                  • 6. Re: Memory Leak - is there a solution?
                    spor1
                    Greetings fellow developers.. I have encountered this same problem.. Does anyone know of any solutions as of yet? I came to the same conclusion as the previous poster ( I created a restart app).. Im using Zinc as well.. And my patience with this issue is getting very thin. I have to deliver this file for my job and would like to NOT have to resort to a refresh application.. Also, a refresh app will not work if the file is swf based, it will only work rather, if the file is an exe.

                    If you have any workable solutions other than a restart exe, please post them here or email me.. I would greatly appreciate it, and Im sure my job would love me for finding a solution ;-)

                    you can reach me at spor1@spor1.com or khariclemens@yahoo.com

                    Have a blessed development session and wonderful day!
                    • 7. Re: Memory Leak - is there a solution?
                      Level 1
                      Greetings fellow developers.. I have encountered this same problem.. Does anyone know of any solutions as of yet? I came to the same conclusion as the previous poster ( I created a restart app).. Im using Zinc as well.. And my patience with this issue is getting very thin. I have to deliver this file for my job and would like to NOT have to resort to a refresh application.. Also, a refresh app will not work if the file is swf based, it will only work rather, if the file is an exe.

                      If you have any workable solutions other than a restart exe, please post them here or email me.. I would greatly appreciate it, and Im sure my job would love me for finding a solution ;-)

                      you can reach me at spor1@spor1.com or khariclemens@yahoo.com

                      Have a blessed development session and wonderful day!