2

I have run my app with instrument and i m getting a memory leak but i dont know at which point that memory leak is happening.

How will i know at which point memory is leaking.

enter image description here

Zohaib
  • 2,845
  • 2
  • 23
  • 33

3 Answers3

2

Check out this article "Actually finding a memory management error with Instruments", from the big nerd ranch. Creating "heapshots" is a good way to start narrowing down the code parts that show no obvious memory management errors at first glance. But as ACB stated already, if a system library is leaking (rare case) there's not much you can do about it. But most of the time the memory issue is always in your apps' code somewhere! :-)

Nenad M
  • 3,055
  • 20
  • 26
  • 1
    Here's a working url - http://blog.bignerdranch.com/590-actually-finding-a-memory-management-error-with-instruments/ – Rymnel Dec 17 '13 at 20:54
1

It says responsible library is quartzcore, and it is only 16 bytes. As long as it is not in the app and the OS is causing the same, you cant do much about this. I would recommend you to ignore this.

If you are facing issues, check the allocation tool -> Live bytes section and check if memory is shooting up when you are selecting a lot of images at the same time.

iDev
  • 23,310
  • 7
  • 60
  • 85
  • but my apps not working because of this. i am adding multiple images from camera to screen via imagePicker. and when i put more than 4 images then all previous images are gone. – Zohaib Nov 28 '12 at 07:52
  • Is this the only leak you got and how is the memory usage when you are selecting more than 4 images? Could be due to the huge memory space used when more than 4 images are loaded at a time. Check the allocation tool, live bytes section. – iDev Nov 28 '12 at 07:56
  • i think so that this is the only leak. i have a blank screen and i m adding images from camera to my black screen of 60x60 size. and i have added gestures to those image. when i am selecting images from gallery everything works fine but when i am opening camera and taking picture than my app doest not behave well. – Zohaib Nov 28 '12 at 07:59
0

I can see from your screenshot that your app is already running in your device/simulator and you are trying to run it again with instrument, try to close your app completely from device and then start it again with instrument.

You can read more details about Xcode instrument from Apple.developer InstrumentsUserGuide

Also I have found another good tutorial about this in Raywenderlich blog

Another good documents is here

Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102
  • Thanks for those links. but i have seen some tutorials . when a memory leakage occur and u click on it it shows at which point that leak is happening but in my case ( in image above ) i cant find out which leakage is happening. – Zohaib Nov 28 '12 at 07:56
  • i have tried it. i have closed app and then run it from instrument. and the result is same. and i cant find my class from where that memory is leaking. i can only see CoreFoundation class, QuartzCore – Zohaib Nov 28 '12 at 08:12