AnsweredAssumed Answered

fetchData(completion:) memory consumption

Question asked by Linnart.Baeker on Jan 21, 2017
Latest reply on Jan 23, 2017 by Linnart.Baeker

method on AGSPortalItem can lead to out of memory kills of the app. It appears that shortly before the completion handler is called, the app suddenly needs four times the size of the download in memory with no apparent reason. In my case its an 100 MB Download. This leads to the App getting killed under Memory pressure. 

On another note it looks like the complete download is stored in memory the whole time. This is probably not ideal even without the 4x memory bug.




portalItem.fetchData { [weak self](data, fetchError) -> Void in

                if let error = fetchError {

                    print("Could not fetch data due to error : \(error)")


                    print("Downloaded portal item")

                    print("Title : \(portalItem.title)")

                    print("Type : \(portalItem.type.rawValue)")

                    print("ID : \(portalItem.itemID)")