Using the Leaks Instruments tool on a new, from-scratch, one-view iOS app reports 23 leaks. This doesn't seem right — am I missing something? Repeated runs yield different leak counts, from 16 to 35. Steps to reproduce follow this screenshot.
A similar, unanswered question, was posted at Memory leak in login with amazon sample ios app
I'm using Xcode 10.2.1 (10E1001); iOS 12.2 (Simulator & device both show leaks, with or without Reveal activated.)
- Create fresh one-view iOS app.
- In Scheme > Run/Debug section, enable
- Memory Management > Malloc Scribble
- Logging > Malloc Stack (Live Allocations Only)
- Run Product > Profile (⌘I)
- First leak check is green; wait for second one.
- Twenty-three new leaks! (As shown above.)
However, apart from Instruments, Debug Navigator disagrees:
- Run normal debug session
- Click "Debug Memory Graph" at top of Debug area.
- Debug Navigator (below) has no purple exclamation marks (leak alerts).
The release notes for Xcode 10.3 say:
That sounds exactly like this issue. So it was a bug (a Heisenbug?), and now it’s fixed.