2 Replies Latest reply on Dec 25, 2006 10:35 PM by neekss

    How Can I increase memory used by director?

    Level 7
      Hi

      I have a tool, written in director, that imports all imagefiles from a
      folder and its subfolders into director cast
      It worked since years without any problem
      But now I have following problem - if the amount of files is big enough,
      director is out of memory, can not create any new member more

      I do it like this

      repeat with i=1 to cFileList
      cFile=cFileList
      mem = new(#image, myCast)
      mem.importFileInto(cFile, [#trimWhiteSpace:FALSE,
      #remapImageToStage:FALSE])
      mem.name=cFile
      end repeat

      At some moment command
      mem = new(#image, myCast)
      fails, it can happen on 500-th file in the list, or an 570-th or on some
      other point. So the problem is not in some definite file, but in memory. How
      can I avoid this problem? Can I purge the memory, used by the program till
      that moment or is there any other way do to it?

      Any help will be appreciated


        • 1. Re: How Can I increase memory used by director?
          Level 7
          Look up save castlib. put this in your loop and and maybe try i mod 10 so it
          only saves every 10 times. This should pull the images from ram to disk, and
          sort of purge the memory for you.

          Timm

          "Jorg Mann" <jorg.mann@gmx.de> wrote in message
          news:emof0k$cqh$1@forums.macromedia.com...
          > Hi
          >
          > I have a tool, written in director, that imports all imagefiles from a
          > folder and its subfolders into director cast
          > It worked since years without any problem
          > But now I have following problem - if the amount of files is big enough,
          > director is out of memory, can not create any new member more
          >
          > I do it like this
          >
          > repeat with i=1 to cFileList
          > cFile=cFileList
          > mem = new(#image, myCast)
          > mem.importFileInto(cFile, [#trimWhiteSpace:FALSE,
          > #remapImageToStage:FALSE])
          > mem.name=cFile
          > end repeat
          >
          > At some moment command
          > mem = new(#image, myCast)
          > fails, it can happen on 500-th file in the list, or an 570-th or on some
          > other point. So the problem is not in some definite file, but in memory.
          > How
          > can I avoid this problem? Can I purge the memory, used by the program till
          > that moment or is there any other way do to it?
          >
          > Any help will be appreciated
          >
          >


          • 2. Re: How Can I increase memory used by director?
            neekss
            you can also use the unLoadMember() function after the save to purge the members which have been already saved.
            More help is there in the Director help file.

            _movie.unLoadMember(fromMemberObjRef, toMemberObjRef)