Memory Allocation in iphone - iphone

I am checking memory allocation in performance tool, i am getting more than 90 MB memory allocation while running an app for 30-40 mins.Can anyone tell me at which extent memory allocation can go or there is some specification of APPLE for memory allocation or what is criteria to upload it on an appstore or what .
Please hme next week app is going to upload on an appstore
Manjot Singh

Use Instruments to find memory leaks: in Xcode, chose the menu Run -> Run with Perfomance Tool -> Leaks. See for example this article or this article on how to find and fix memory leaks with Instruments.

I pretty sure that your app has tons of leaks, if you are saying that memory usage grows during time. This could be the reason why appstore can reject your app, so you'd better fix that.

Related

Memory size was keep on increasing while running application in Xcode 5 with iOS 7

I am implementing an iPhone application and when I ran this app initially it was showing memory size was 5.3MB
and after 10 min it was showing memory size was 185.3 MB.
I'm releasing objects manually and also analyzed my app, I have only one memory leak(that to return object in class method). What was the problem? is it harm to app while apple approve it?. Please help me. Thanks in advance.
No, you really shouldn't release it with this kind of a leak (or memory accretion). It will lead to crashes and that will cause data loss and upset users.
Heapshot analysis is designed to track down these kinds of problems. That is, use the Allocations Instrument to track memory growth over time iteratively and then eliminate the large memory consumers.
Apple will probably approve it as long as it is not crashing within the review time.
But no you should not release the app if you have a memory leak like this. Your app will have poor user experience and might crash if the users device memory runs full. You will get a low app store rating.
I would suggest you find out which object is taking up so much memory and fix it. If at all possible switch to ARC, this will take away some leaks.
I have same problem too. NSZombieEnabled flag work for me. I think this might be helpful to cope up with ARC. I have followed this link: How do I set up NSZombieEnabled in Xcode 4?

How to use Instrument in iOS

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.
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! :-)
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.
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

Reading this output from Instruments in Leaks mode?

I'm new to memory management and have been playing around with Instruments in Leaks mode. This is my latest output and I was wondering if I could get some feedback from the SO community. It seems as if my total leak amount is quite high, even though the individual leaks are not that big (I think). Should I be concerned? Should I be looking to get rid of all of these leaks?
N.B. The app runs on the iPhone and doesn't use any network.
The screen you are looking at is not the Leaks. It is the memory allocations of your app.

How to improve memory footprint for iPad apps

I have an iPad app that is doing really well, zero crashed reported by Apple after 5 months and 3 releases.
However occasionally the OS kills the app, my guess is for shortage of free memory.
I am not doing anything right now in the warninglowmem event.
I would like to receive some solid recommendation of what I should do to improve the memory footprint. What tools and tricks I can start using to understand where I am right now and how further I can go with the improvements.
I'd suggest starting by reading about Instruments which will let you see what memory you're using and how much. In particular, the "Quick Start" and "Analysis Techniques" sections in that document should get you pointed in the right direction.
Using the "Allocations" instrument will help you watch your memory grow and tells you where it's being allocated.
You might also try using the "Leaks" instrument, which will point out if you're leaking memory (rather than just allocating too much).
There is an awesome instrumentation tool included with Xcode that lets you look for leaks. From the Run menu choose Run With Performance Tool -> Leaks and you can see where you might be leaking memory over time. That's a great place to start. Next you can look at the "Allocations" tool to see how you're utilizing memory over time. Start there and you'll learn a ton.

how to detect memory leak in new sdk 3.2?

I have implemented ipad application foe that i want to check memory leak.I know that there is some extra feature for memory leak.but i dont know how to enable.please advice me if possible.
To check for memory leak you can run your app with the Leaks tool. To do so, go to Run > Run with Performance Tool > Leaks.
In order to get precise information about leaks, activate "Extended detail" by pressing CMD-E, and click on a leaked block.