views:

287

answers:

1

How do I go about determining what is currently in the Mozilla Flash Plugin memory for AVM1? I am trying to debug a large application we have built and need to see what is getting garbage collected and when. I think we have a number of references causing major content nodes not to unload during the user session. Right now it is all guess work.

+1  A: 

even if you had a profiler in Firefox it would be guesswork as the garbage collector is a "bit" hectic in AVM1. it'll do a collection if there's a sudden peak in memory usage and of course you managed to remove all references to your objects. what works for me is: 1. remove all listeners 2. object = null 3. delete object

but anyway, you should spend your time optimising your code and making sure you don't leave rogue listeners (or use Delegate to pass scoped method references around, dirty but effective) instead of trying to find a way to precisely monitor memory. if you really need to, use an OS based one and check the Firefox process, or switch your project temporarily to Flash Lite and use Device Central.

dain
We are talking a pretty large project built by 10 developers or so, I did all the core engineering but I do not believe that during the last 12 months all of my practices were followed. Hence I need some general forensic solution to help me hunt down offenders. Cheers,
Jotham
ah ok, i see what you mean :) well, i don`t think there`s an easy way, testing and finding which part is the offender will have to be a manual process, once you have an idea you can use debug tools like http://osflash.org/xray, though at the end of the day you`ll end up looking through code anyway..
dain