- Home /
Question by
Spree_User · Jun 12, 2018 at 08:20 AM ·
memory usageprocess
Getting memory usages from other processes
Hi!
I need to check the memory usages of another process from within a unity script. At the moment I'm just trying to iterate through all processes and try to print the WorkingSet64 for that process, like so:
Process[] processes = Process.GetProcesses();
foreach (Process p in processes) {
p.Refresh ();
UnityEngine.Debug.Log (p.ProcessName + ", workingSet64: " + p.WorkingSet64);
}
Problem is that they all return 0. When debugging, I can see that all values that has anything with the memory to do has a value of 0. Why is this happening, and is there another approach I could take here?
The problem I'm having is that another third part process I have to use seems to have a memory leak, and I'm looking for a way to restart that process when the memory reaches a certain point.
Comment