Garbage Collection : Class Definitions?

Hey All,

So I’ve been asked to write in garbage collection to our entire games platform. Not a wonderful job considering it consists of well over 5,000 classes. Most of our compiled games packages consist of about 500 to 1000 classes. Lots right?

In any case I wrote in destroy functions into all of the classes and a destroyDisplayList type static function to ensure all the displayObjects get collected. Using the Flash Builder profiler to test the process all the way through I’ve had pretty good success in getting a game that runs at peak memory of about 50mb down to a collected memory of 600k. Not bad I thought but our client reckons they want it down to 200k.

With in the profiler the memory snapshot lists the final collected objects to be (roughly) :

[TABLE=“width: 500”]
[TR]
[TD]Name[/TD]
[TD]Instances[/TD]
[TD]Memory[/TD]
[/TR]
[TR]
[TD]Object[/TD]
[TD]846[/TD]
[TD]35512[/TD]
[/TR]
[TR]
[TD]Class[/TD]
[TD]410[/TD]
[TD]517323[/TD]
[/TR]
[TR]
[TD]Everything else[/TD]
[TD]143[/TD]
[TD]34165[/TD]
[/TR]
[/TABLE]

So as you can see the Class definitions seem to take a whooping 517k (ish)! I’ve made sure that any of the loaded swf’s are unloaded using “unloadAndStop(true)” and there are no display objects left.

If these are actually class definitions how do I get rid of them? The only reference in the Object References panel shows newclass and global$init:global$init() and a class which has been garbage collected.

I’m at a total loss of what else to do! Has anyone got any more information ?

Cheers,

Charlie.