Hi guys.
I’m currently working on a little memory profiler and I’m running into some problems:
Here’s my current code:
var process = Process.GetCurrentProcess();
UnityEngine.Debug.Log(process.Id + " : " + process.ProcessName);
var pagedMemorySize = process.PagedMemorySize64;
UnityEngine.Debug.Log(pagedMemorySize.ToString());
Sadly the second output prints “0” which is… a little confusing. The description says that I should get the allocated memory of the process, which should the current process itself (either unity itself in editor mode or my game if I run it as standalone). So what could be wrong that I get zero memory?
Also tried System.GC.GetTotalMemory but the numbers are very confusing and I couldn’t figure out how the numbers are calculated.
Thx for help!