Is there a way to retrieve the total amount of native memory usage from a running C# application (either from within C# or an external CLI tool)? Something equivalent to the output of the non heap sections in jcmd's VM.native_memory?
I know about GCMemoryInfo.PinnedObjectsCount but that is only about the object count, not the size.
The intent is to publish it as a metric that can be tracked (i.e. not using complex debugging like Visual Studio, WinDbg or equivalents).
EDIT: I would be happy with the total amount of unmanaged memory, but something more granular like jcmd's output would be even better. Main goal is to track down native memory allocations via calls like Marshal.AllocHGlobal.