I'm trying to debug some memory leaks in an iOS application.
Previously I have used the Instruments/Leaks tool provided with XCode and the "Mark Generation" button in that tool to successfully locate sources of the memory leaks.
However, now I get the error in the title of this question.
There were some things to do that worked last time, at least this helped before:
This developer forums thread offers some work-arounds, like profiling with debug build, but that does not help, at least in my particular case.
Is there some other work-arounds or likely things I'm doing that prevent the Leak tool from working?
If the memory usage tends to increase as you use your app, then it’s likely that some memory isn’t being released appropriately. The Instruments tool provided with Xcode can give you valuable insight into the lifetime of objects used throughout your application.
Under “Choose a profiling template for,” select your device and application (see troubleshooting if it’s disabled). Then select the Allocations instrument and click “Choose.” (It’s worth noting that the Leaks instrument can also be useful, but it is primarily used to detect memory that is never freed, not memory leaks from retain cycles.)
Xcode’s leaks function is a very handy tool. We can simply press on the record button and navigate and perform actions throughout a large app, and the instrument will document new leaks in the report. We also have a way to save the recording and review it in the future: Thank you very much for reading!
On the first screen, a button, on tap, let’s us navigate to the second screen, where we intentionally create a memory leak using a retain cycle. We open the Xcode leaks instrument first and press the record button When the app automatically launches, we press on the navigate button that presents our leaking view controller
One thing I noticed is that it gives that error when testing with iOS simulator, but when profiling on a real iOS device it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With