Sorry for posting here, my question is not related to beta, but this forum is dedicated to profiling.
I’d like to know what API should be used to understand how much (managed) memory was allocated?
From what i saw there are a few different APIs, not sure which is the most accurate one:
We do have the profiling tag on the forums which I and others in the profiler team follow
Anyways: as the naming in the APIs you mentioned indicates somewhat: those APIs give you what the Memory Profiler Module shows as “Total” value, i.e. Native + Managed.
If you want to get the managed memory only, you should be looking at
Profiler.GetMonoHeapSizeLong for what the current cap for the heap is, where exceeding that cap will cause a GC.Collect and potentially heap growth, and also for what the OS sees in terms of managed memory.
Not that those are not going to report Native allocation from Mono itself, so no reporting on C# Type Metadata that would be allocated for Reflection stuff, only the managed heap.