Search code examples
xamarin.iosmonogame

Is my game too big? How much memory is it using?


I want to find out how much memory is used by my game because the game runs too slow. How can I do that in Xamarin Studio?

I get no error messages but everything runs too slow. I tested my game on a Windows phone device, and there it wasn't slow. But now on the iPhone simulator in Xamarin Studio, the game runs much slower and I don't know why.

In addition, is there a connection between the frame rate of the game and memory used by the game?

Is the frame rate automatically decreasing if the game uses too much memory? How can I measure the frame rate?


Solution

  • You can use the Xamarin Profiler to do so. But do notice that doing so requires a Xamarin Enterprise License.

    Otherwise, for iOS, you can use Instruments which comes with XCode. You can perform the following types of analysis methods using Instruments:

    1. Overall Memory Use
    2. Leaked Memory
    3. Abandoned Memory
    4. Zombies

    The different methods are described here.

    Monitoring Overall Memory Usage is described in detail here, but you basically need to:

    1. Launch Instruments.
    2. In the profiling template selection dialog that appears, click Activity Monitor.
    3. Choose your device and app from the target device and process lists.
    4. Click Choose to create a trace document.