I have written the code in objective C ARC project everything is working fine but after running my project 20-25 my project crash. i have tested my project on xcode instrument there i found no leaks my in instrument i have observed that my live bytes are continually increasing. Is there is any way to handle this or there is any way to remove everything all and free the allocated memory of my project.
Asked
Active
Viewed 137 times
0

rmaddy
- 314,917
- 42
- 532
- 579

Muhammad Saqib
- 993
- 2
- 15
- 37
-
2Can you post some code? In instruments, you can see what objects are allocated. Maybe post the code that creates objects of that class? – pgb Aug 23 '13 at 18:40
-
1posting the stack trace would be helpful. – Marcus S. Zarra Aug 23 '13 at 19:09
-
it does not give any memory stack for that. i have also enable the NSZombie and exception break point. it also not giving the memory leaks on instruments. – Muhammad Saqib Aug 23 '13 at 19:12
1 Answers
3
The most common cause of this is retain cycles. Retain cycles happen when you have two objects A and B that hold strong references to each other. By definition, an object won't get released by ARC until its reference count is 0. Therefore, you can't delete A unless you delete B first, and you can't delete B until you delete A.
To solve this, change one of the strong references to a weak one. Typically, you want the container class to hold a strong reference, and the child class to only hold a weak reference to its container. Here are some examples and more detailed information:

Community
- 1
- 1

Lawrence H
- 467
- 4
- 10