1
1
I want to compare how much physical memory and CPU power google chrome and firefox use. So I tried to do this with htop which I usually use to keep track of my system resources and found out that I'm not able to draw a conclusion. I've read several threads but I'm still confused and this is why: When I filter with F4 for e.g. chrome, htop shows me dozens of tasks for which I don't know if they are threads or processes. AFAIK threads share the same address space but processes not. I can press F5 to have a tree view and there is one parent for all tasks. The assumption that the value of the parent task in the RES column gives the total memory and the value in the CPU% column the total CPU usage for this program regardless if it uses multiple processes or threads is apparently wrong. I found that out by doing this little experiment: I ran a python program I found which uses multiprocessing for some calculations. This is what I saw in htop: the parent value in the CPU% column shows 0 the whole time but there are 7 tasks which go up to 100% (my system has 4 physical cores with 2 threads each).
So could someone please explain what's going on and how can I check the total usage of physical memory and CPU for a program?
From what I've read it's not straightforward to determine the exact memory usage but the absolute value is not important in my case, I just need values I can use for comparison.