I am profiling an iOS app(Swift) using Allocations in XCode Instruments. My objective is to understand the objects that are created but not deallocated. Will the objects that still has strong reference will be destroyed when i close the app and reopen again? Or do i need to restart the device in order to clear the heap memory occupied by the app?
Asked
Active
Viewed 169 times
0
-
1You don’t need to restart device. Force-quitting the app should be sufficient. Just leaving the app is not sufficient, though. But you really should figure out what’s consuming the memory and resolve those issues. If it’s just caches, that’s relatively easy to resolve. If it’s strong reference cycles, those can be identified via “debug memory graph”. Leaks are found via Instruments’ “Leaks” tool. If you’re not sure what’s consuming the memory, the Allocations tool is useful. Also, try simulating memory pressure and see how much is recovered. – Rob Aug 03 '20 at 05:40
-
See https://stackoverflow.com/a/30993476/1271826, which walks through how to use "debug memory graph" feature, plus links to old WWDC videos that talk about how to diagnose memory issues. – Rob Aug 03 '20 at 05:49
-
thanks Rob. this helps! – pepsin s Aug 03 '20 at 16:21