I am testing my application and observing the memory. Initially, when the application has loaded the memory allocated in 15.7MB. I tap on a cell (using a UICollectionView
) that triggers a segue to another view controller, that does have a delegate. I have made the delegate of type weak var
. When the segue is complete and the view is presented the memory is now 87.6MB. However, when I hit the back button, the memory is still allocated.
This code is executed when the back button is pressed:
_ = navigationController?.popViewController(animated: true)
And will continue to increase by anywhere between 80mb-120mb each time I tap a collection view cell. And as a result, the application crashes. This issue only happens to this specific view/class/custom cell. This view/class/custom cell does indeed download and display images/videos from Firebase.
What can I do to tackle this issue?