Search code examples
swiftxcodememory-leaksxcode10xcode-instruments

Xcode 10.2 detects memory leaks in a new single view app


Can anyone reproduce memory leaks in a new and unchanged single view app created with Xcode 10.2.1 (10E1001) / Swift 5 / iOS 12.2 ? How to work seriously with the integrated memory leak tool? Are there any workarounds?

The first image shows 1 memory leak (iPhone 8) enter image description here

The second image shows 37 memory leaks (iPhone Xr simulator) enter image description here

NOTE

The amount of leaks vary every time I start the analyzer tool.

EDIT 1

I noticed, that Xcode 10 uses a new build system. Maybe the issues are based on this. Build System Release Notes for Xcode 10

EDIT 2

This question seems to be very similar to mine.


Solution

  • The question is solved with the new Xcode 10.3 release!

    Resolved an issue where running an app in iOS 12.2 or later under the Leaks instrument resulted in random numbers of false-positive leaks for every leak check after the first one in a given run. (48549361)