as far as i know, there is no way of dumping the garbage manually - you have to wait for the flash plugin to dump it once it has been marked

you can check chapter 14 of essential actionscript 3.0 (moock) for more info about that


On 12 Mar 2008, at 15:54, Henry Cooke wrote:

Hey all,

I'm currently working on a Flash module to sit inside a larger Flash
site being developed by another agency. This module needs to be loaded
and unloaded as needed, and has a fair few library assets, quite
substantial codebase and will be running PV3D or Away3D, so I need to
be very careful about destroying everything when my module is finished
with; the container site is pretty resource-hungry too.

So, my current problem: I've built initialisation and destruction
routines that run on Event.ADDED_TO_STAGE and
Event.REMOVED_FROM_STAGE, and a test loader which loads and removes my
module. However, watching the test loader unload my module in the
Flash Player shows no noticeable drop in memory after my destructors
have been called in the module and $loader.unload() has been called in
the test loader, so it seems like a lot o stuff is gettign stuck in
memory.

Basically, my destructors set any class variables which reference
objects to null, which I believe should mark them for garbage
collection, if nothing else points to them? I also do things like
removeChild() and bitmapData.dispose() where relevant.

I've compiled in XRay, which shows what you'd expect: various bits
present on stage while my module is loaded, all gone when it's not.

So I guess my questions are: does anyone know any secret voodoo
techniques to track down memory use in the Flash player? Is there
anything better I can be doing than just setting pointers to null?
Back in the AS2 day, I'd suspect the _global namespace of becoming
cluttered and just try and nuke _global[ package_name ], but dirty
hacks like that don't exist in our shiny new AS3 world, do they?

I'd be grateful if anyone can offer any advice about how to properly
clear up memory after unloading my module. This is my first AS3
project, and none of my old tricks work :(

Cheers,
Henry
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to