tags:

views:

51

answers:

2

Dear friends , I find Flex need more RAM than Flash , I use the Flex Profiling to trace it , I don't know why GC don't recycle mxml object when I don't wanna use it ? Thank you.

+1  A: 

Data binding is notorious for hiding references. You have to make sure every single reference to everything is destroyed. I've gone so far as to make recursive destroy functions that walk down a components display list nuking everything it can find (removing children, etc).

So, set any of your properties to null, set any bound properties to null, keep at it and you are bound (har) to find the culprit.

Of course, this could all be way overkill. The GC works on its own schedule and it just might not need the ram yet so it isn't clearing the space. It doesn't really care if you don't want to use it ;)

So, either there is a stray reference or the GC just hasn't kicked in yet.

Joel Hooks
Or the GC has simply decided it doesn't need to cleanup because you have plenty free RAM left anyway. There's a hundred possible reasons really.
Matthew Scharley
A: 

If you have the professional edition of Flex Builder, you can use the memory profiler to find the object in question and see how it is anchored to the object graph.

Richard Szalay