AckeeCZ / Reqres

Simple network activity logger for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory Leaks

georgysolovei opened this issue · comments

There are a lot of memory leaks while using Reqres.defaultSessionConfiguration() instead of regular URLSessionConfiguration for Alamofire. The app increases its size several times.

Hi,

thanks for having interest in Reqres! 🎉

We consider Reqres to be primarily debug tool which should not be part of a production app. For those cases we usually turn it off in non-debug environment.

#if DEBUG
let configuration = Reqres.defaultSessionConfiguration()
configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders
let alamofireManager = SessionManager(configuration: configuration)
Reqres.sessionDelegate = alamofireManager.delegate
return alamofireManager
#else
return SessionManager.default
#endif

Maybe if you could please provide some more information about those leaks (like memory graph from Xcode or some Instruments information), we might look more into it. Increase of memory consumption doesn't have to be a proof of memory leaks as Reqres uses some more non-trivial additional objects.

Thanks in advance 🙂

Hi. I have been already using preprocessor conditions. For debug purposes I profiled the app with leaks that point to Reqres. The trace archive is here.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.