13 Replies Latest reply on Oct 30, 2008 5:39 PM by Newsgroup_User

    Memory Leak with cloneModelFromCastMember()?

    Level 7
      Hello Experts!

      I have been experiencing an apparent memory leak within Director 11 when
      using cloneModelFromCastMember().

      I was making the assumption that calling resetWorld() on a w3D member
      onBeginSprite() would garbage collect any models previously cloned into that
      when I previously ran the movie.

      However, if I repeatedly start and stop the movie Director Gobbles roughly
      10Mb more memory each time. The memory usage does not reduce upon calling
      resetWorld()

      A good way to replicate this is to use cloneModelFromCastMember() on a
      largeish model in a repeat with i = 1 to 50 loop on the on beginSprite
      handler.

      Start and stop the movie over and over to see Director's memory usage hike
      up.

      Anybody have any advice why this is happening? Do I need to explicitly
      delete all models cloned into a member on stopMovie????

      Cheers

      Richard Smith


        • 1. Re: Memory Leak with cloneModelFromCastMember()?
          Level 7
          It appears that the problem doesn't happen on Director 8.5 (although I'm
          still looking into it).

          Can anyone confirm? I'm wondering if this is a new Version 11 memory leak?

          Cheers

          Richard


          • 2. Re: Memory Leak with cloneModelFromCastMember()?
            Nanomedia Level 1
            quote:

            Originally posted by: Richard
            It appears that the problem doesn't happen on Director 8.5

            Are you sure of that?


            quote:

            Originally posted by: Richard
            Can anyone confirm? I'm wondering if this is a new Version 11 memory leak?


            Yes.

            • 3. Re: Memory Leak with cloneModelFromCastMember()?
              Level 7
              Hi Nano,

              Can you get the memory leak to happen on Director 8.5 then?

              "Nanomedia" <webforumsuser@macromedia.com> wrote in message
              news:gd403g$rrl$1@forums.macromedia.com...
              >
              quote:

              Originally posted by: Richard
              > It appears that the problem doesn't happen on Director 8.5

              > Are you sure of that?
              >
              >
              >
              quote:

              Originally posted by: Richard
              > Can anyone confirm? I'm wondering if this is a new Version 11 memory
              > leak?

              >
              > Yes.

              Oh oh.... Bad news... Thanks for confirming. Is Adobe aware of this one?

              Anyone else have any info / thoughts?

              Cheers

              Richard


              • 4. Re: Memory Leak with cloneModelFromCastMember()?
                Level 7
                I have just submitted an Adobe bug report. Will let you know if I get a
                response at all...

                Cheers

                Richard


                • 5. Re: Memory Leak with cloneModelFromCastMember()?
                  ensamblador Level 1
                  I Had this problem with director 10.x. I seems that garbage collector dont work or it isnt completely efficient. I believed that this issue was solved in director 11, but it seems not.


                  • 6. Re: Memory Leak with cloneModelFromCastMember()?
                    as a rule of thumb:
                    whenever possible avoid cloneModelFromCastMember in the first place.
                    It is highly unrecommended and the intel engineers always recommended to use loadFile() with an external w3d file, which is much better than having the w3d file in the castlib and using cmfcm.
                    each cmfm rebuilds the whole scene and takes a lot of time the bigger the scene is.
                    apart from glitches like leaks, which you found right now and other things.

                    I work very much with sw3d and I barely have more than one shockwave3d member in any of my movies. in very rare cases I use 2 sw3d members. Other than that I use one member where I build and load everything into from external w3d files with loadFile(), which is much more appropriate. the only downside is that I can't change the model name, but there are ways to deal with it.
                    • 7. Re: Memory Leak with cloneModelFromCastMember()?
                      Level 7
                      Hi Zzzorro,

                      Thanks for the advice!

                      Why does cloning from external w3D members help? Does it avoid the memory
                      leak? It never used to happen on Director 8.5 so it has to be a new Version
                      10 / 11 bug right?

                      I need to import several weightmapped boned characters into a 3D member, and
                      due to export issues each character has to have it's own w3D file.

                      So I have to perform cloning at runtime to build the world. I also need to
                      clone these characters based on the level, so I can't use just one single 3D
                      member for both these reasons.

                      Thanks for any further ideas.

                      Richard Smith



                      "zzzorro" <webforumsuser@macromedia.com> wrote in message
                      news:gd4sn2$2l8$1@forums.macromedia.com...
                      > as a rule of thumb:
                      > whenever possible avoid cloneModelFromCastMember in the first place.
                      > It is highly unrecommended and the intel engineers always recommended to
                      > use
                      > loadFile() with an external w3d file, which is much better than having the
                      > w3d
                      > file in the castlib and using cmfcm.
                      > each cmfm rebuilds the whole scene and takes a lot of time the bigger the
                      > scene is.
                      > apart from glitches like leaks, which you found right now and other
                      > things.
                      >
                      > I work very much with sw3d and I barely have more than one shockwave3d
                      > member
                      > in any of my movies. in very rare cases I use 2 sw3d members. Other than
                      > that I
                      > use one member where I build and load everything into from external w3d
                      > files
                      > with loadFile(), which is much more appropriate. the only downside is that
                      > I
                      > can't change the model name, but there are ways to deal with it.
                      >


                      • 8. Re: Memory Leak with cloneModelFromCastMember()?
                        Necromanthus Level 2
                        quote:

                        Originally posted by: Richard
                        It appears that the problem doesn't happen on Director 8.5 (although I'm
                        still looking into it).
                        Can anyone confirm? I'm wondering if this is a new Version 11 memory leak?


                        Hi Richard,
                        cloneModelFromCastMember() and cloneMotionFromCastMember() are very old Intel/Macromedia "unfinished business".
                        http://forum.necromanthus.com/necroforum.php?forum=1&topic=94
                        I don't remember the v8.5 "status", but I'm sure in v9 and MX2004 they were present.
                        Talking about Adobe bug report, the upcoming hotfix has nothing to do with the Shockwave3D Asset, so ...

                        cheers

                        • 9. Re: Memory Leak with cloneModelFromCastMember()?
                          Level 7
                          Thanks for the info!

                          Richard

                          "necromanthus" <webforumsuser@macromedia.com> wrote in message
                          news:gd4vh8$5qh$1@forums.macromedia.com...
                          >
                          quote:

                          Originally posted by: Richard
                          > It appears that the problem doesn't happen on Director 8.5 (although I'm
                          > still looking into it).
                          > Can anyone confirm? I'm wondering if this is a new Version 11 memory
                          > leak?

                          >
                          > Hi Richard,
                          > cloneModelFromCastMember() and cloneMotionFromCastMember()
                          > are
                          > very old Intel/Macromedia "unfinished business".
                          > http://forum.necromanthus.com/necroforum.php?forum=1&topic=94
                          > I don't remember the v8.5 "status", but I'm sure in v9 and MX2004 they
                          > were
                          > present.
                          > Talking about Adobe bug report, the upcoming hotfix has nothing to do with
                          > the
                          > Shockwave3D Asset, so ...
                          >
                          > cheers
                          >
                          >
                          >


                          • 10. Re: Memory Leak with cloneModelFromCastMember()?
                            Level 7
                            Hi, an Adobe engineer has replied, and I've sent them a .dir file to
                            replicate the leak clearly. They have acknowledged the problem, and will get
                            back to me as soon as they have completed their investigation...

                            Just to update you. Thanks.

                            Richard Smith

                            "Richard" <donotuse@funpods.com> wrote in message
                            news:gd33up$qal$1@forums.macromedia.com...
                            > Hello Experts!
                            >
                            > I have been experiencing an apparent memory leak within Director 11 when
                            > using cloneModelFromCastMember().
                            >
                            > I was making the assumption that calling resetWorld() on a w3D member
                            > onBeginSprite() would garbage collect any models previously cloned into
                            > that when I previously ran the movie.
                            >
                            > However, if I repeatedly start and stop the movie Director Gobbles roughly
                            > 10Mb more memory each time. The memory usage does not reduce upon calling
                            > resetWorld()
                            >
                            > A good way to replicate this is to use cloneModelFromCastMember() on a
                            > largeish model in a repeat with i = 1 to 50 loop on the on beginSprite
                            > handler.
                            >
                            > Start and stop the movie over and over to see Director's memory usage hike
                            > up.
                            >
                            > Anybody have any advice why this is happening? Do I need to explicitly
                            > delete all models cloned into a member on stopMovie????
                            >
                            > Cheers
                            >
                            > Richard Smith
                            >


                            • 11. Re: Memory Leak with cloneModelFromCastMember()?
                              Level 7
                              Latest reply...

                              ---------------------------------------------------------------

                              was asked to pass on ther following info from a higher level:

                              "This has been logged as a bug in Director 11 and the product engineers are
                              aware of the issue.
                              Unfortunately, we do not have a workaround for this issue at this time, nor
                              can we say if/when a patch may be available"

                              -------------------------------------------------------------

                              I guess that's all folks... I'm going to have to recode my whole level
                              building system to try and side step this. I didn't notice the problem till
                              now as I was running Dir8.5 previously.

                              Unity for my next project then...

                              Richard Smith


                              • 12. Re: Memory Leak with cloneModelFromCastMember()?
                                Ex Malterra Level 1
                                Thanks for the info Richard.

                                How unfortunate. I've used cmfcm extensively. I've noticed that my system often gets sluggish after a while, that must be the reason. I wasn't aware of the loadFile() method, I'll start using it in place of cloneModelFromCastmember() from now on. Thanks zzzorro.

                                I've been using cloneMotionFromCastmember() quite a bit in a recent project, can anyone point me towards an alternate method for that or am I stuck with it?
                                • 13. Re: Memory Leak with cloneModelFromCastMember()?
                                  Level 7
                                  Interesting news update!

                                  Thanks to Sujai, Adobe appear to have fixed the issue on a forthcoming
                                  HotFix3. (not sure when this will filter out to the plugin based public).

                                  This came as a great surprise to be honest :)

                                  A refreshing change!

                                  Richard Smith


                                  "Richard" <donotuse@funpods.com> wrote in message
                                  news:gd33up$qal$1@forums.macromedia.com...
                                  > Hello Experts!
                                  >
                                  > I have been experiencing an apparent memory leak within Director 11 when
                                  > using cloneModelFromCastMember().
                                  >
                                  > I was making the assumption that calling resetWorld() on a w3D member
                                  > onBeginSprite() would garbage collect any models previously cloned into
                                  > that when I previously ran the movie.
                                  >
                                  > However, if I repeatedly start and stop the movie Director Gobbles roughly
                                  > 10Mb more memory each time. The memory usage does not reduce upon calling
                                  > resetWorld()
                                  >
                                  > A good way to replicate this is to use cloneModelFromCastMember() on a
                                  > largeish model in a repeat with i = 1 to 50 loop on the on beginSprite
                                  > handler.
                                  >
                                  > Start and stop the movie over and over to see Director's memory usage hike
                                  > up.
                                  >
                                  > Anybody have any advice why this is happening? Do I need to explicitly
                                  > delete all models cloned into a member on stopMovie????
                                  >
                                  > Cheers
                                  >
                                  > Richard Smith
                                  >