Reputation: 465
I got the memory leak in instrument with Xcode 7.3 and using swift, please someone explain the actual reason for memory leak.
Screenshot of instrument is attached below. It have some problem with NSURLSession in swift.
Upvotes: 0
Views: 402
Reputation: 10417
It isn't clear whether the leaks are real, but AFAIK, anybody who has ever run leaks on an app that uses NSURLSession or NSURLConnection has seen leaks deep down in the stack. The details vary from one OS version to the next.
These cache objects are probably purgeable memory, so they can disappear when the system needs memory. That means that the leak probably isn't a big deal. And the allocations should all go away when you release the session (or the last open session that shares the same backing cache). If they don't, that's probably a bug in the OS.
Basically, I wouldn't worry about it unless it is leaking so much memory that your app gets killed. There's not anything you can do about these leaks because they're deep in the guts of the URL loading system. The best you can do is file bugs, and it never hurts to do that. :-)
Upvotes: 0