2

I have this below image & I use Instruments to check for memory leaks. I am new to iOS so I haven't used Instruments before to check the memory leak. I saw many tutorials but they explain how to do. But I can't understand which graph color is my memory leak and I don't have any memory leak or not.

enter image description here

This is my app running with Instruments until last process of my app. Can any one suggest whether I have a memory leak or not? And what is that "Sky blue color" refer for? And what is that red color bar? And if I have memory leak, where will it show in this image?

I am using Objective-C and Xcode 7.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
mack
  • 603
  • 2
  • 9
  • 22
  • Doesn't look like you're running the leak detector. That looks like the allocations tool. – user3386109 Aug 20 '16 at 06:15
  • Yes its allocation option.What is it for ??. – mack Aug 20 '16 at 06:17
  • It shows how much memory the app is using (that's the sky blue graph). Theoretically you can figure out which objects in your app are using the memory (that's the text on the bottom part of the screen). Note that if the sky blue part looks like a ramp that's constantly climbing, that's probably a bad thing. Your graph is flat after the initial startup, so it's fine. – user3386109 Aug 20 '16 at 06:27

2 Answers2

1

You can check whether your app leak or not by leak profile:

go to product-> click on profile -> click on Leaks instrument

After open the leak instrument play with your application.

enter image description here

Saurabh Jain
  • 1,688
  • 14
  • 28
0

There are typically two causes of memory leaks:

  1. A retain cycle, in which two or more objects have strong references to each other in such a way that they are never released (e.g. A -> B -> C -> A).
  2. An object is allocated but never freed. With Automatic Reference Counting, this is very rare, although it can still happen if you’re working directly with lower-level classes that don’t support ARC

Here is a useful Apple doc to figure it out

vaibhav
  • 4,038
  • 1
  • 21
  • 51