Have an app that was developed for both low res and high res iOS and Android devices. Using TexturePacker to create the sprite sheets (display.newImageRect(…)) using 75% (@2x) and 50% scaling variants (75% is so that I can keep the total app memory down because it’s pushing 400MB as it is). When I test the app in the Simulator, I’m outputting both the “memory” and “texture memory” in the console via:
function printMemory(event) collectgarbage( "collect" ); local memUsage\_str = string.format( "MEMORY = %.3f KB", collectgarbage( "count" ) ); print( memUsage\_str, "TEXTURE = "..(system.getInfo("textureMemoryUsed") / (1024 \* 1024) ).. " MB" ); end timer.performWithDelay(1000,printMemory,-1);
and it runs flawlessly on ALL devices in the Simulator. No surprise there.
So then I go over to xCode, plug an iPad Air 2 device into my Mac and compile/run so that I can monitor the metrics. What’s nice is that I can monitor the ACTUAL CPU/Memory/Energy Impact/Disk/Network/FPS (Frames Per Second) in the Debug Navigator Dashboard for the device I want to run it on. Absolutely love the dashboard view and it certainly helps with how an app runs on a particular iOS device. As is with the Simulator, runs flawlessly on the iPad Air 2 along with the iPhone 6 plus. CPU never goes above 20% (with everything that I have running such as Textures/CBEfx/Animations etc…) and total Memory usage stays around 280 MB.
Now when I plug in a second generation iPad mini (2012), build (in xCode) and run my app so as to monitor the metrics, CPU ranges between 6% and 100% (with everything running as indicated above) and Memory stays around 190 to 230 MB (as it should be lower based upon the fact that I’m not using the @2x images).
However, it crashes on the second gen iPad mini. Now taking for granted that the iPad Air 2 has over 1GB of Memory and the iPad mini has 500MB of Memory, there’s not much room to play on the iPad mini and with the potential of other apps opened and/or processes running (which is an assumption we as developers have to make), the 190 to 230 MB is pushing it. In my test on the iPad mini, I make sure that nothing else is running on the device, however, when I build and run the app in xCode and view the Memory usage in the Debug Navigator, there seems to be an equal amount of memory (if not more) being consumed via “other processes.” I don’t want to delve into the “what could that be if nothing else is running,” but for the sake of your getting a visual of what I’m seeing, I point it out.
Getting to the purpose of my post, as I said, the app crashes on the iPad mini. BTW, If anyone is wondering, yes, I get the “Received Memory warnings.” in xCode’s console. So when it finally crashes (quits), nothing is displayed in the console other than those “Received Memory warnings…” but it does show the following error message in the Debug Navigator window from the main.mm file:
// // main.mm // // Copyright (c) 2016 A Complete Teacher. All rights reserved. // #import "CoronaApplicationMain.h" #import "AppCoronaDelegate.h" int main(int argc, char \*argv[]) { @autoreleasepool { CoronaApplicationMain( argc, argv, [AppCoronaDelegate class] ); } return 0; }
CoronaApplicationMain( argc, argv, [AppCoronaDelegate class] ); --> Thread 1: EXC_BAD_ACCESS (code=1, address=0xcd56060). See included image.
On all high res devices, it runs flawlessly, however, it does eventually quit on the low res devices (both iOS and Android). Anyone have any insight?
Correction, iPad mini Second Gen…