Xcode Instruments: peak RAM iPhone apps running in Simulator?

Is Activity Monitor (aka Memory Monitor) the only tool in Xcode Instruments that can measure the overall RAM usage of an iPhone application running in Simulator? Only this line shows instant wired RAM?

And how accurate is that compared to the iPhone hardware, especially considering the OS / POS calls for the VM?

I see 7-8MB wired RAM digits only for standard Xcode iPhone project templates (other than OpenGL) compiled and running. At the same time, Object Allocations displays well under 1MB for all objects.

+4
source share
2 answers

No, there is a much better way to do this.

Go to the Run menu and select Run with Performance Tool , then Object Allocations .

This will launch the Tools and show the use of RAM. It is also useful for detecting memory leaks if you select Leaks instead of Object Allocations .

+7
source

I agree that Simulator is just an β€œAPI simulator,” the behavior you see will be at least somewhat dependent on how OS X manages memory. And the limitations are obviously different, for example, you can exceed 128 MB of RAM or even 256 MB, which is obviously not possible on any current iPhone or iPod Touch (at least at the time of writing ...).

I still found it useful in OpenGL to make sure textures and other elements are properly freed, but beyond that, this is just an approximate recommendation.

However, if you want to see the memory usage on the device, a fairly simple solution. Just configure the device in Xcode and go to Run> Run with the Performance Tool> Object Allocations, then the assembly will be sent to the device, and the Object Assignment tool will appear next to Xcode and display on the device’s memory usage.

+1
source

Source: https://habr.com/ru/post/1299631/


All Articles