Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App memory usage difference between simulator and device

I ran my app on my Macbook Air and my Iphone 6s and the below image is the memory usage profile after I go through all the UI in my apps. In the two scenario, I have performed similar tasks and duration. Why is the simulator memory usage so much higher than the actual device. Should I be concerned even though the device memory usage seems to be reasonable?

enter image description here

like image 864
user172902 Avatar asked Aug 22 '16 04:08

user172902


People also ask

How much RAM does Xcode simulator use?

Everything is working fine, except for simulator which is reportedly using 5 GB of memory. This is waay more than on my intel mac that used 900mb to run.

How much memory can an Android app use?

Early Android devices had a per-app cap of 16MB. Later this cap increased to 24MB or 32MB.


1 Answers

Good Question.I appreciate you for asking this kind of question.

Apple Documentation says

Simulator is a useful tool, but 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. For this same reason, always test the performance of your app’s user interface on a device. In Simulator, your app’s user interface may appear to run both faster and smoother than on a device

Xcode’s iOS simulator reports 2GB RAM for iPhone 6S, 4GB for iPad Pro

Xcode's iOS simulator shows 2GB of RAM for iPhone 6s and 6s Plus, 4GB for iPad Pro

Finally the solution from discussion is

Why the iPhone Simulator is Awesome

I found the exact solution from jbat100's answer.

Rendering performance of OpenGL ES in Simulator has no relation to the performance of OpenGL ES on an actual device. Simulator provides an optimized software rasterizer that takes advantage of the vector processing capabilities of your Macintosh computer. As a result, your OpenGL ES code may run faster or slower in iOS simulator (depending on your computer and what you are drawing) than on an actual device. Always profile and optimize your drawing code on a real device and never assume that Simulator reflects real-world performance.

Iphone Simulator - Allocates way too much memory and runs slow compared to device

like image 167
user3182143 Avatar answered Sep 20 '22 14:09

user3182143