We have a huge movieclip of 5000 by 5000 pixels with different (transparant)
We can make an instance of the movieclip and work with it, we can move
layers, scale them, ...

But as soon as we add the MovieClip to the stage the ram memory-usage jumps
to 200 MB!
My guess is that flash retrieves all the bitmapdata from the MovieClip (all
25 million pixels) so it can display it. And all this data takes up around

For cpu performance and obviously the memory-issue we use bitmapdata with
clipRect to extract a single 'screenshot' of 600 by 400 and add that to the
stage instead of the entire mc. At first the memory-usage is reasonable, but
as we start to explore the map it goes up again. It keeps rising to the
point that, when you have explored the entire map, the memory-usage is back
at around 200MB, same as when we added the mc to the stage.

We use BitmapData.dispose() but this doens't seem to help either as the
garbage-collector doesn't free up the ram instantly.
We tried using tiles, we cut the entire mc up in tiles and added and removed
the necessary tiles, but again, the memory starts low and rises as we
explore the map.

It's hard to believe that all those papervision-applications run so smoothly
using BitmapData while we only use a couple large jpg's and have such
extreme memory-usage.
Is there any way to make the garbage-collector pass (we use flash player 9)
or reduce the memory-usage?

Any help or tips would be greatly appreciated!
Flashcoders mailing list

Reply via email to