To help monitor/track down memory leaks, we need to know what memory our app is consuming.
This is for a Xamarin.Forms app; currently we're only running on Android, but will be on iOS in the future.
I know we can get the OS memory used on the device, in the Droid project, by using code like below:
public static MemoryInfo GetMemoryInfo()
{
MemoryInfo retVal = new MemoryInfo();
retVal.MaxMemory = Java.Lang.Runtime.GetRuntime().MaxMemory();
retVal.FreeMemory = Java.Lang.Runtime.GetRuntime().FreeMemory();
retVal.TotalMemory = Java.Lang.Runtime.GetRuntime().TotalMemory();
return retVal;
}
Is there any mechanism for getting a figure for the memory being consumed in the Mono runtime?