I have a little problem with memory usage. When I load images from drive, I use:
func queryFinished(_ notification: Notification) {
[...]
document?.open(completionHandler: { (success) -> Void in
if (success == true){
self.imageArray.insert(compress(document.image), at: index)
self.collectionView.reloadData()
}
}) }
}
Everything fine, after that I compress the images. The problem is memory keeps the big images data. Even if I move back to the root viewcontroller, the memory still keeps the large files.
Is there any way to clear that? Thank you very much!