So just to follow up. I hacked up the UIComponentCleaner so that is will
work with IVisualElementContainers. The code is far from perfect, but it
seems to work for now:
http://pastebin.com/cxcSWGNK

I intend to do a cleaner version of this when I have time and to host it in
GitHub, but i'm just using pastebin for now.
Note, that patching the following files is required:


   - mx.binding::FunctionReturnWatcher - Change the private "document",
    "parameterFunction", "parentObj" and "functionGetter" properties to
   properties to public scope.
   - mx.binding::PropertyWatcher - Change the private "parentObj" Object
   and protected "propertyGetter" Function properties to public scope.
   - mx.binding::RepeaterComponentWatcher - Change the private "clones" Array
   property to public scope.
   - mx.binding::Watcher - Change the protected "listeners" and "children"
   - Array properties to public scope.

Hope someone finds this useful,

Marcus


On 26 November 2013 13:22, Marcus Wilkinson <wilkinsonmar...@gmail.com>wrote:

> So we have a tabbed application where a memory leak of about 5MB doesn't
> seem to be collected properly. I am looking for an easy way out to help out
> the GC. After using the flash builder profiler it seems that lots of
> bindings amongst visual components and other things are still hanging
> around after the tab is closed. All of these things belonged to the tab but
> as far as I am aware, there are no other references to the original view.
>
> I understand that nulling out references can help the garbage collector
> identify which objects can be collected since it doesn't need to consider
> one large 'island' before it can collect.
>
> I found this tool which looks like it has potential, but unfortunately is
> specific to Flex 3:
>
> https://code.google.com/p/flex-uicomponent-cleaner-and-gc-initiator/source/browse/trunk/com/tommyb/util/gc/UIComponentCleaner.as
>
> Does anyone know of or have anything like this for Flex 4?
>
> Marcus
>

Reply via email to