From @smyrgl on December 18, 2015 22:2
I have created a sample project to demonstrate this behavior here: https://github.com/smyrgl/adktest
So here's what I'm noticing: it seems that in ASCollectionView the memory isn't properly being freed up. This is very easy to see in the sample project: just play around with clicking on items in the collection view (each will push to another collection view) and scroll and watch the memory usage continue to increase. Firing memory warnings will not change this behavior, the memory usage just keeps climbing.

However if in the ASCellNode I manually implement clearContents like this:
override func clearContents() {
super.clearContents()
imageNode.image = nil
}
Then memory usage stays under control. Also if I define a custom subclass of ASImageNode that implements clearContents I also get the correct memory behavior:
class ClearImageNode: ASImageNode {
override func clearContents() {
super.clearContents()
image = nil
}
}

I'd be glad to create a diff which adds this to ASImageNode but I am uncertain if there is a gotcha to this change.
Copied from original issue: facebookarchive/AsyncDisplayKit#955
From @smyrgl on December 18, 2015 22:2
I have created a sample project to demonstrate this behavior here: https://github.com/smyrgl/adktest
So here's what I'm noticing: it seems that in ASCollectionView the memory isn't properly being freed up. This is very easy to see in the sample project: just play around with clicking on items in the collection view (each will push to another collection view) and scroll and watch the memory usage continue to increase. Firing memory warnings will not change this behavior, the memory usage just keeps climbing.
However if in the ASCellNode I manually implement clearContents like this:
Then memory usage stays under control. Also if I define a custom subclass of
ASImageNodethat implementsclearContentsI also get the correct memory behavior:I'd be glad to create a diff which adds this to ASImageNode but I am uncertain if there is a gotcha to this change.
Copied from original issue: facebookarchive/AsyncDisplayKit#955