0

I am creating an app using ARC but my app is crashing due to Received memory warning. The App is working fine in simulator. But in case of iphone device, If i run the app for few minutes then on doing anything, the app crashes straightaway. I have checked my app by xcode instrument. My app folder size is 6 MB but all memory allocation is showing 63 MB on xcode instrument.

Because of this reason, presentViewController-Animated-Completion is getting slow during navigation. Does anyone have any solution why this is happening?

enter image description here

Anand Gautam
  • 2,541
  • 3
  • 34
  • 70
  • Why is your app using 63MB at runtime? Is you code leaking memory? Did you investigate? What did you find out? – Amar Oct 29 '13 at 09:16
  • @AmarI am updating my question, pls see in attach screenshot.I am also not getting the problem. Thanks – Anand Gautam Oct 29 '13 at 09:50
  • My OverallBytes and #Overall seems to keep increasing even if I'm not doing anything. Is this bad ?? My Net Bytes and #Net seems to stay stable. I am using "Instruments" with the "Leaks" option. – Anand Gautam Oct 29 '13 at 12:22

1 Answers1

5

Leaks are not the only source of memory problems. A leak is memory that you have allocated that you no longer have a pointer to so that you can release it. With ARC, this is very rare.

Another cause is bad usage of memory. It is possible that you are creating objects and holding on to them with a strong reference for longer than you need to. Without seeing our code it's hard to tell where you are doing this. Using the snapshots and seeing what objects are in memory and where they are created is a good way to start debugging this type of problem.

Abizern
  • 146,289
  • 39
  • 203
  • 257
  • @AbizernThanks for giving me time, i am trying to resolve this problem from last day but still it is. Can u pls tell me that is it possible that exactly where it is leaking memory in class code? – Anand Gautam Oct 30 '13 at 05:44
  • It's not possible for me to tell you from that picture. You need to check the snapshots yourself. – Abizern Oct 30 '13 at 09:42
  • I have checked but it is not displaying any red line in leak(call tree) graph on Xcode instrument. – Anand Gautam Oct 30 '13 at 10:00
  • I went through from this link http://stackoverflow.com/questions/10493470/how-to-exactly-find-where-memory-is-leaking-in-project-of-iphone – Anand Gautam Oct 30 '13 at 10:04
  • I didn't say you had a leak, I said to check for memory that you are holding on to when you don't need to. You need to check your snapshots. https://developer.apple.com/library/ios/documentation/AnalysisTools/Reference/Instruments_User_Reference/AllocationsInstrument/AllocationsInstrument.html – Abizern Oct 30 '13 at 10:19