views:

212

answers:

1

I'm having a hard time managing my memory in flash lite. are there any pointers i should care about ? or best practices?

ive been reading every 60 seconds the garbage collector runs.

i'm deleting my objects/movieclips like

mc = null; delete mc;

and making sure every listeners is deleted on it.

still nothing seems to happen..

+2  A: 

Flash's garbage collector isn't deterministic - it runs when it can run and while it may check to see if it can run at a regular interval, there's no guarantee it will run. If your SWF is constantly chewing CPU the GC will never have time run.

Flash Lite uses ActionScript 2 which does have one "nuke" option for visual assets - MovieClip.unloadMovie(). If you've got a movieclip, running unload on it will kill everything within it.

Branden Hall