3 Replies Latest reply on Jul 4, 2006 2:43 AM by HughGB

    too many sprites to remember

    HughGB Level 1
      Hi Forum,

      I've written a basic jigsaw program using a template of different colours. The code adds sufficent scripted sprites to make a jigsaw from the coloured template. This may be up to several hundred sprites. This works fine on most newer computers I've tried, most with 512+ MB RAM and at least Pentium III. With a few pieces, upto about 50, the program runs on an older machine: Win 98 SE, 400Mhz, Pentium II with 196 MB of RAM (funny amount of RAM - it's an old laptop with the largest amount of RAM we could fit at the time). Using more than about 50 pieces causes and error, sometimes as a script error and sometimes as an error regarding the number of sprites, which it hasn't done for a while and I can't remember it completely. However, it states that it has cleared all available sprites and is out of memory.

      The process of copying sprites using the template seems to be fairly processor intensive and I supppose that somewhere along the line that the memory is exceeded - giving the errors. By the way the image is about 400 × 500 pixels. However, if I create the final jigsaw on my computer and just reload a puzzle using saved sprites as templates for new scripted sprites (i.e. cutting out the getPixel(), setPixel() steps) I still get similar error messages.

      Is there any way to monitor the memory use at runtime, I don't have Director (Director MX) installed on the old machine, or to control how the memory is used so that I can limit the effect of more pieces?

      Of course there could be another reason - any ideas are welcome.


        • 1. Re: too many sprites to remember
          HughGB Level 1
          Hi Forum,

          Just an update and the contents of the error alert message. The message in the alert reads:
          "Out of memory loading member 42 of PLAYER·CAST 9, even after purging all purgeable castmembers."


          • 2. Re: too many sprites to remember
            CenturyMan1979 Level 2
            It could have to do with your code since I have an app that will load in a couple hundred images while using copyPixels on each one and not hit the error that you are talking about, so I can't see 50 images creating the issue you are describing.

            You can monitor you memory status by having the Window's Task Manager up when you start your application and make sure it is set to ontop always.
            • 3. Re: too many sprites to remember
              HughGB Level 1
              Thanks CenturyMan1979,

              I've had a quick look into the memory usage using the Task Manager in XP and System Monitor in Win 98 - it seems, on XP at least, that the CPU usage for the pixelGet() and pixelSet() routines are not as demanding as I thought -some other routine may be causing the overload. However, the Kernel use goes straight to 100% when I start the projector on Win98 so I cannot see what happens - there are other metrics but I'm not sure just yet which to monitor and it seems that memory usage on Win98 differs from XP.

              Thanks for your help - it's a start.