I want to create a program that can display the amount of RAM used by Google Chrome. Chrome uses a process for each tab and each plug-in / extension (mostly), so you cannot confidently view the activity monitor for the amount of RAM.
My idea was to give the program a name for the process (Chrome), and it would search for each child process. Then I will add the amount of memory received by the entire parent process to get the answer.
The problem is that I cannot find a class that can give me the amount of memory received by the process.
I found a way to get the PID on behalf of the application (and vice versa) with the sample code PIDFromBSDProcessName written in C. But I can not find the memory, either in NSRunningApplication or in NSTask from the NSWorkSpace classes.
Any idea?
If you have any advice, I will also read about it with pleasure!
source share