may help you . Presumably you're looking at the wrong column in "Task manager" or using the wrong property in Process class.. I guess you're looking for WorkingSet64 not PrivateMemorySize64. PrivateMemorySize64 is the amount of virtual memory allocated for the process, not the physical memory. For physical memory use WorkingSet64.
hope this fix your issue Sergmat is correct in his comment (thanks by the way); I actually found RAMMAP myself yesterday and used it and it revealed the problem. Our server runs a very heavily used SQL Server instance. RAMMAP reveals that there is a 105GB region of memory used for "AWE" Address Windowing Extensions - which are used to manipulate large regions of memory very quickly by things like RDBMS's (SQL Server).
How do i get memory usage of specific application just like it show in the windows task manager?
hope this fix your issue The answer maybe a bit huge but it will answer the entire question except for the DISK USAGE part. Getting the CPU utilization in percentage(%)
public FinalResult as float;
public async void GetCPUCounter()
CounterSample firstValue = cpuCounter.NextSample();
await Task.Delay(900); //delay is required because first call will always return 0
CounterSample secondValue = cpuCounter.NextSample();
FinalResult = CounterSample.Calculate(firstValue, secondValue);
GetCPUCounter(); //calling again to get repeated values
public class Memory
public int TotalRamInMb;
public int TotalRamInGb;
public double UsedRam;
public int UsedRamPercentage;
public string GetTotalRam()
var CI = new ComputerInfo();
var mem = ulong.Parse(CI.TotalPhysicalMemory.ToString());
int Mb = Convert.ToInt16(mem / (double)(1024 * 1024));
TotalRamInMb = Mb;
if (Mb.ToString().Length <= 3)
return Mb.ToString() + " MB physical memory";
return (Convert.ToInt16(Mb / (double)1024)).ToString() + " GB physical memory";
TotalRamInGb = Convert.ToInt16(Mb / (double)1024);
public async void GetUsedRam()
Process allProc = Process.GetProcesses();
foreach (var proc in allProc)
URam += ((proc.PrivateMemorySize64) / (double)(1024 * 1024));
UsedRam = URam;
UsedRamPercentage = (UsedRam * 100) / TotalRamInMb;
How to calculate memory usage as Task Manager does?