You can try GC.GetTotalMemory
:
It Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval > before returning, to allow the system to collect garbage and finalize > objects.
It Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval > before returning, to allow the system to collect garbage and finalize > objects.
or
using System.Diagnostics;
Process currentProc = Process.GetCurrentProcess();
Once you have a reference to the current process, you can determine its memory usage by reading the PrivateMemorySize64 property.
long memoryUsed = currentProc.PrivateMemorySize64;