Search code examples
xcodexcode7xcode-instruments

What does a minus sign mean in the Leak Instrument?


I'm using Xcode's Instruments to find out if there's any leaks in my App. But I find the graph a little confusing. The app gets a cross when doing a certain job, but after that it gets minus signs only.

enter image description here

The reference count seems to get zero finally. I'm not very sure about the reading.

enter image description here

The official documentation is a bit outdated.


Solution

  • There's no explanation in the more recent Leaks instrument documentation about the snapshot icons.

    enter image description here

    By profiling code that leaks, here is a meaning for the leak indicators:

    • Green check (tick): No leak occurred in the snapshot interval (and no prior leaks exist).

    • Red x (cross): One or more leaks occurred in the snapshot interval.

    • Grey dash (minus): No new leak occurred in the current snapshot interval, but a leak from a prior snapshot still remains.

    If leaked object from the earlier snapshot was deallocated, you would have seen a green check instead of a grey dash.

    You can submit a documentation bug report to Apple requesting that an explanation be added to the documentation.