I'd like to get the percentage of memory usage of a process.
This is what I currently have:
return new PerformanceCounter("Memory", "% Committed Bytes In Use").NextValue();
However, this is the RAM usage of my whole computer, not only the process.
When trying to add a string parameter to PerformanceCounter
, it doesn't work because you apparently can't provide a process name for this counters category.