On 2/25/16, 4:33 AM, "XaviConde" <[email protected]> wrote:
>After reviewing my 'fix', actually what was happening is that it was >making >the application crash, which is why the application memory was not >increasing... > >Anyhow I think there should be only 1 instance of NonLeakySubcomponent in >memory at any time, irregardless of whether the GC would collect it or >not. >I'll keep on looking into it. Well, it is my understanding that GC schemes (especially mark&sweep schemes like Flash uses) rarely if ever promise that in these types of scenarios there will only be one instance at any time. I think you are describing more of a reference counting scheme. And what we recommend when we talk about recycling renderers and object pooling is essentially building your own reference counting scheme in ActionScript. I've been told that there are at least two sets of objects for the sweep, and if you do add more code to remove all children and other circular references, you might find that your object ends up in the first set and gets GC'd before the GC runs out of time and stop sweeping. Things with circular references supposedly take longer to be swept, even though the circular references really should be slowing the mark phase. HTH, -Alex
