iOS App Memory Differs in Debug and Adhoc(Distribution) - ios

My app seems to run pretty flawlessly in Debug. The memory footprint seems reasonable, but for whatever reason when I run an Adhoc version of the game the memory footprint increases dramatically.
Here are shots of what I am seeing in instruments:
Debug:
http://i.stack.imgur.com/JsjZ2.png
Adhoc:
http://i.stack.imgur.com/MYlcr.png
I noticed four 4MB allocations in the object list on the Adhoc build that are not there in debug. Is this something special that happens with Adhoc builds? I was disconnected from the debugger for both runs.
This memory increase is causing the application to crash very frequently on devices with only 256 MBs of Memory. Is there anything I could do to remedy this or is it an iOS thing that just happens? I don't think we have any differences in build settings that would bloat the application that much and we don't do any special allocations for Adhoc builds that I know of.
Any help would be greatly appreciated.
Thanks!

Related

iOS10 memory issue

I have an app that is available on AppStore, it is a biological recognition app, so there's lots of C/C++ code in this app, and it goes well on iOS7 to iOS9, but when I tested in on iOS10, it always crashed dued to memory issue after several trials, I tried the Allocation instrument, not much leaks.
When I tested it in xCode, I found something interesting(I already shut down every app that run background), the memory usage of other process increased dramatically on iOS 10.
iOS10_iPhone5s
But it didn't increase so much on iOS9:
iOS10_iPhone5
So I have several questions here:
what's in other processes, it should be the apps that run background, but why the memory usage increased even I shut down all the other apps?
why I can only reproduce this issue on iOS10? and it runs well on iOS7-iOS9.
Can anybody help me? thank you.
"Other Processes" includes literally every other program that is currently running on your Mac. That number has nothing to do with the simulator. It does not measure processes that run in the simulator.
If you run iOS Simulator Xcode shows memory stats from your Mac.
Please refer this as well
Running out of memory in 'Other Processes' in Usage Comparion Xcode iOS9
iOS Memory Management -- Other Processes RAM Increasing

What memory usage threshold when I receive memory warning in iOS

I did receive these warnings in my iOS app
Received memory warning. Level=1
Received memory warning. Level=2
The problem is, after Level=2 warning, my app will be killed...
How many MB of memory my app could use until I receive such warnings? I'm getting < 30Mb of "Live Bytes" in XCode Instruments before my app gets killed for level 2 memory warning. Is this my reading mistakes, or am I not suppose to use more than 30Mb of memory in my app?
I am testing using iPod Touch 4th Gen and iPhone 4, and targeting those devices as minimum.
Any advice are appreciated, and thanks in advance!
first of all I will ask myself what are you loading into memory that takes so much space. Second if you are releasing everything in the correct way. ARC simplify our lives but is not a garbage collector, there could be abandoned memory and other issues that makes memory grow. In iphone 3gs the limit of memory is about 25MB, when you reach it you get a memory warning, if your app is not able to flush some memory after that it will close.
If you want to support old devices like iPhone 3GS I would suggest not to exceed 12-15MB.

Tracing the root cause of low memory warnings

I see a lot of low memory warnings being issued when running my application in Instruments. The total memory allocation does not exceed 5.02 MB. What could be the reason? I checked the Leak Instrument as well. There I see leaks, but due to some framework classes. None are beacause of my project classes. How to trace the root cause?
Please see attached snapshots of Leaks & Allocation instruments:
Some versions of the OS on some iOS devices will send memory warnings to the foreground app when a background app (Mail, Messages, Music player, etc.) needs sufficiently more memory. This has nothing to do with the amount of memory your app is using. If your app is not using a lot of memory (well under 10MB), it can usually ignore these memory warnings, as the OS will usually kill a background app that is using more memory than your app instead of your app (no guarantee though, whether your app frees memory or not!).
If you want to avoid all these memory warnings when testing, put the device in Airplane mode and force quit all the background-aware apps in the multi-tasking bar before running your app.

iOS - i receive memory warnings but have no idea why

I am developing for the iOS and checking my app with IPhone and IPad.
I receive many memory warnings (didReceiveMemoryWarning is called) but have no idea why.
My app is using ~35MB in the peak points, and 4-5 MB when it the lowest point.
I tried to find leaks using 'instruments' but could not find any critical issues.
Is there a good way to find out why the system sends memory warnings?
Memory warning is to be expected in an iOS app. It doesn't have to be because of your app. Other apps are still in memory even if the apps are suspended. The OS will do memory management by sending memory warning and kill apps when necessary. As long as you're using reasonable amount of memory (with little to no memory leak) and handle didReceiveMemoryWarning properly, you'll be fine.
Also, when your app is in suspended mode, if your app is using little memory footprint, your app will more likely to survive killing process. As app with larger memory footprint will be terminated first.
I also found that "Product -> Analyze" (Shift+Command+B) can help you sort out some code issues before you start using Leaks. With the introduction of ARC this became less useful though.

Memory Warnings on iPad, but only when running through instruments

I'm working on an app that works fine on all devices (all the way back to 3.0 and the first iPhone in fact). If I profile useing'Activity Monitor' instrument (Memory Monitor) tool the app runs fine, with no crashes, and no excessive memory usage reported.
However, when I run it in Profile mode with the 'Allocations / leaks' tool selected, on iPad 1, I get lots of memory warnings in quick succession followed by a crash (about a second after all the memory warnings fire off, it crashes), but this ONLY happens when running with the allocations / leaks monitor enabled.
I need to find out why this is happening. Is there a compatibility issue with iPads and the latest version of instruments and that specific tool? Does it take up an excessive portion of memory?
Thanks in advance,
Stew

Resources