nlampi / SwiftGridView

Swift based data grid view.
MIT License
58 stars 15 forks source link

Possible memory leak #37

Closed robcecil closed 6 years ago

robcecil commented 6 years ago

I was examining the memory footprint of my app over time, as I performed some central functions that involve creating instances of SwiftGridView. In my app, I support multiple instances open, through a tab interface:

simulator screen shot - ipad air 2 - 2018-06-20 at 12 45 32

In my test, I opened four of my 'views', each of which corresponds to an instance of a SwiftGridView. Then I closed each of them, for an empty environment.

Then I invoked the memory graph tool in Xcode. I searched to verify that my pertinent class instances were not leaked (in my case, GridViewController and GridViewModel). They were cleaned up.

BUT I noticed that all four instances of the SwiftGridView (and corresponding SwiftGridLayout) were still around, as well as many hundreds of my UICollectionViewCell derivatives (a modified BasicTextCell, plus some sibling classes).

screen shot 2018-06-19 at 4 55 35 pm screen shot 2018-06-19 at 9 13 19 pm screen shot 2018-06-19 at 9 13 24 pm
nlampi commented 6 years ago

I have pushed a new version (0.6.4) which fixes a reference that should have been weak. When testing removal/allocating I see that memory sticks where expected on my end. Can you test and see if you are still seeing the same issue?

robcecil commented 6 years ago

Thanks. Will test shortly

robcecil commented 6 years ago

I repeated my test and I didn't find any leaked instances of either the Grid or the layout.