arm6 devices showing much higher memory usage - ios

I have built an app in MonoTouch - it works with both arm6 and arm7 devices, I've tried to be as careful as possible with my memory usage and on the arm7 devices it works beautifully - running it through the apple instruments program I can see an average 'live bytes' in the allocations tool of around 4MB.
However on the arm6 devices (iPhone 3G, iPod touch 2nd Gen) - it is instead showing memory usage of around 22MB - gives frequent low memory warnings and obviously eventually crashes.
Is there any build setting or any particular thing that anyone can think of that could be causing the app to have such a high memory footprint on the 3G device vs the 3GS (arm7) devices?
It's especially frustrating as these devices have plenty of memory anyways.
Thanks for your time,
Liam

That's a huge difference!
My best guess is that Apple's Instruments is misreporting the memory being used (in either or both case) and that, in fact, the real memory requirements of both are much closer.
In this case the older, armv6, devices have less RAM and will give low memory warnings before the newer, armv7, devices (with more RAM). IOW the behaviour you're seeing could be normal, i.e. you could be near the limits for older devices.
Now it could also be a bug or some other configuration that differs between your builds (e.g. a Debug versus a Release build). It would be helpful if you could share (or create a test case) this with us (Xamarin) so we can try to reproduce the issue.
NOTE:
I assume you're talking about a single, armv6, application used on different devices. But even if you used different builds (one for arm6 and one for armv7 or a fat application) this would only affect native code generation. As such it will affect the binary size but it should not have a (huge) effect on the runtime memory requirement of applications.

Related

Is the Xcode simulator slower when using a newer simulated device?

I have a fairly old Mac, so I'm trying to find ways that I can speed up the Xcode simulator. I have an assumption that simulating older devices will be faster than newer ones. This assumption comes from the fact that older devices have less powerful processors, so therefore, when simulated, take up less processing time on the Mac. However, I don't actually know if this is true. So will the Xcode simulator run faster if it's simulating an older device?

Is the iPhone Simulator actually as "slow" as device itself

I wanted to know whether the iPhone Simulator in XCode "really" emulates the device hardware.
So when deploying to iPhone 4s Simulator, will my app actually be "as slow as on a real iPhone 4S device" and when using an iPhone 6 Simulator, will it be as fast as on a real device?
The simulator does a really lousy job of indicating app performance. In fact it doesn't try.
For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory. (It also actually links again OXS frameworks, not iOS frameworks. There is glue code in the simulator that makes it work with iOS code, but it's not perfect.)
However, some things, like Core Image filters and OpenGL graphics, are actually slower on the simulator than on a real iOS device.
The bottom line is that you can't really tell ANYTHING about your app's performance from the simulator, and shouldn't try. You can do basic development on the sim, but when it comes time to test performance, use real devices, and make sure to test on the oldest/slowest device your app supports (usually an iPhone 4s or iPad 2).
You also can't test memory usage on the simulator. A program that will run out of memory and crash on an iOS device may run just fine on the simulator.
The Simulator is a useful tool, and it should not be the only way you
test an app. Because the Simulator is an app running on a Mac, it has
access to the computer’s resources, including the CPU, memory, and
network connection. All of these resources are likely to be faster
than those found on a mobile device. As a result, the simulator is not
an accurate test of an app’s performance, memory usage, and networking
speed.
Source

Is there any way to set simulator to work on limited memory? [duplicate]

This question already has answers here:
Is there a way to set the amount of memory available in the iPhone Simulator?
(4 answers)
Closed 8 years ago.
As we all know that simulator has more memory than devices. Generally for unit testing every developer use simulator before test project on device but sometimes in the case of unavailability of device, Is this possible to set simulator work on the limited memory?
For example is there any option in tool bar to set simulator's memory on 16GB/ 32GB memory so that it will work in the same way an iPad having 16Gb memory works if we set memory limitation to 16GB.
I guess this will solve your question :- Is there a way to set the amount of memory available in the iPhone Simulator?Update(Copying the content of below link):- https://discussions.apple.com/thread/3870841?tstart=0
Not possible. The simulator is an OS X application and thus you have no control over memory allocation. For details, read the part about OS X memory management here:
https://developer.apple.com/library/ios/#documentation/Performance/Conceptual/ManagingMemory/ManagingMemory.html#//apple_ref/doc/uid/10000160i.
Update 2:-Even though iOS Simulator is a useful tool, never make it the only way you test an app. Because iOS Simulator is an app running on a Mac, it has access to the computer’s memory, which is much greater than the memory found on a device. As a result of the increased memory, iOS Simulator is not an accurate test of an app’s memory usage. For this same reason, you should always test the performance of your app’s user interface (UI) on a device. In iOS Simulator, your app’s UI may appear to run both faster and smoother than on a device.
Reference link:- https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/TestingontheiOSSimulator/TestingontheiOSSimulator.html

iOS and Cocos2d: my app REALLY slow on simulator but is FINE on device

..I am wondering whether there is some setting I should change to get my iOS 5.0 app running fine on an iPhone IOS 5.0 simulator. It runs at only 12fps instead on my device runs at 60fps. Any help? I would have expected the simulator to work fine..
I am using XCode 4.3 and Mac OS X 10.7.3.
Simulator performance is completely and utterly irrelevant. The Simulator runs on your Mac's CPU, that's multiple times faster than the fastest iOS device. The Simulator does however not use hardware graphics accelerations, so it's easily maxed out even though your Mac is so much faster. Lastly, which of your app's users are going to run your app on the Simulator? Answer: no one!
That said, there is still reason to be alarmed. You get 60 fps on the device, that's great. But which device? If it is an iPhone 4S or iPad 3, that device is a lot faster than older devices like iPhone 3GS (or even older yet) or iPad 1. So depending on which device is the oldes device you're developing for, you might still have a problem. Try to find or borrow such a device, and test it on that oldest-supported device, and do test only with a release build.
Consider the facts:
Simulator performance sucks
Retina Simulator performance sucks even more
iPad Retina Simulator performance is beyond good & android
You're most likely the only person ever to run your app in the iOS Simulator
Therefore:
Simulator performance is irrelevant
Simulator performance can not be compared to device performance
The Simulator is for quicker testing of your app's business logic, nothing else. Not even Samsung copied it.
In addition:
Debug build performance is largely irrelevant. At least verify performance measurements in release builds.
Test on oldest supported device. Otherwise you have no way of knowing whether the previous generation device from the device you're testing on may still render 60 fps or only renders 20 fps. That's quite possible.
Lastly, to answer your actual question: the only thing you could do is to make sure you run the standard (ie non-Retina) resolution Simulator. There's really nothing else you can do besides getting a Mac with a (much) faster CPU.
For graphics, par for course. Dont use simulator for any user experience validation, but stick to devices. Dont waste a minute trying to tweak your workstation settings or looking for ways to improve simulator performance. In any event, your are trying to deploy to devices after all no ?
Some functions work faster on simulator (depending on your workstation of course), like data or computation intensive functions. As always, benchmark on your devices, dont be fooled by 'suitable' simulator performance.

"live bytes" different on simulator versus device

I have a program that is showing, in the allocations instrument, approx. 72 MB of "live bytes" but when I run the profiling on my iPod touch, it shows 6 MB. I don't understand why the vast difference. Can anybody please explain this?
Keep in mind that the iOS Simulator is a simulator, not an emulator.
The iOS Simulator works by compiling your iOS application to x86 code, and linking it against a set of system frameworks which simulate their iOS equivalents on a desktop computer. These frameworks are, of necessity, not identical to those that you'd find on "real" iOS -- they are, after all, compiled for a different CPU architecture, and are "talking to" desktop hardware, not a handheld device.
Knowing this, it should be understandable that some aspects of application performance may be radically different on the Simulator than on a real device. Keep this in mind, and test your code early and often on real hardware!

Resources