androidunity-game-enginemonitoringmemory-consumption

Memory Monitoring Tool for Unity Applications on Android


I am currently developing a memory intensive application in Unity3D. Now I want to know, how much memory the applications needs at certain times and actions.

I know the memory monitoring tool in AndroidStudio, but it seems, that it doesn't really correlate with my observations of the memory consumption of the application itself.

Is there a good way to monitor the memory consumption of an Unity3D App deployed on an Android phone?

Thank you.


Solution

  • You can use built-it Profiler tool, it's pretty accurate and with graphs you should easily find memory/cpu spikes.

    Also, Unity gives you this: http://docs.unity3d.com/ScriptReference/Profiler.GetRuntimeMemorySize.html

    Very nice way to measure resources usage by selected objects.

    Furthermore, you can use PerformanceCounter, but you have to include the complete .NET 2.0 libraries (not the subset).

    System.Diagnostics.PerformanceCounter ramCounter = new PerformanceCounter("Memory", "Available MBytes");
    Debug.Log(ramCounter.NextValue()+"MB");