Process tree mem usage calculation (.net related)

Community Forums/General Help/Process tree mem usage calculation (.net related)

ziggy(Posted 2012) [#1]
Just in case there is any .net coder here (I've asked this too on the msdn forums, but no luck).

I need a way to monitor the physical memmory usage of a process tree. I'm not talking about the WorkingSet64 of a process, but the WorkingSet64 of the process and any child process started by it.
Currently, my algo is using the WMI namespace on .net to extend the bluit-in process class with a "ParentID" property, and I'm using the GetProcesses method in order to get a list of all running processes. Then I iterathe through all of them to check which ones are parented to the root process i'm trying to monitor. Then, recursivelly, I do the same to get the child process of any child process, all in all, summing the Memmoryworkigset64 of each one. BUT this is damn slow. To a point it is not really usable.

Is there any better way (I hope so) to do this? I'm trying to monitor memmory consumption of the third party compiler + debugger + runing app on the IDE I'm developing.

Thanks! I hope to find an answer.... sometime... not sure here's the right place but the MSDN forums are so bloated that no one does really bother reading this kind of requests...

EDIT: I'm looking for a platform agnostic solution, as I need it to work natively on x86, x64 and potentially any ARM processor running windows.

Last edited 2012