How to read Activity Monitor?

Hi MPUers, I often find it difficult to understand the amount of memory/CPU an app is consuming. e.g. Based on the screenshot below, if I need to understand how much Chrome is consuming, I have to add up all the subprocesses which isn’t possible of course. Is there a different way to know the total memory an app (and it’s subprocesses( are consuming?

If there are alternative to Activity Monitor, please suggest :slight_smile:

If I were doing this, I’d start by taking a screenshot every so often and then analyze them. For example, your screenshot shows Chrome using about 2 GB, which I think is pretty normal, but it would be useful to monitor the usage over time. Then, depending on what you learn, you could look into some other tools. I found this article that might help. iStat Menus is a popular choice with MPUers and it’s listed #1 in this article but I’m not sure whether it has any logging capability, which I think I’d want for analysis.

There’s a terminal command called top and another called ps. I don’t think they will tell you anything more than Activity Monitor but could probably be used as part of a shell script to gather data over time.

1 Like

Thanks. I understand, I think I was trying to understand the total memory/CPU and app (and its subprocesses) are consuming from Activity Monitor

Just curious. What do you plan to do with this information?

macOS manages real and virtual memory with (probably) complex algorithms already. With that known, what is it your are trying to do?

I only take a look from time to time to this section of Activity Monitor to see if something is going wrong with some app. If it shows something like the following screenshot, I do not really dig into individual memory usage. So, for example, this tells me that some swap has been used on my system and it’s still being used because I haven’t restarted my computer in 18 days. Apart from that swap usage there is no “memory pressure” so at this moment everything is fine.

But going to your particular question, Activity Monitor is not “grouping” processes into apps, it’s just displaying the child processes launched from the Chrome app and it’s not aggregating the sum, that’s why it seems “illogical” that the parent Chrome app (with the icon) displays less memory usage than the rest of subprocesses.

You can get an approximate memory usage aggregate for Chrome with the following Terminal command:

ps aux -o pid,rss,%mem,command | grep Chrome | grep -v grep | awk '{print $15, $2/1024}' | awk '{sum += $2} END {print sum}'
4 Likes

I like the Terminal one-liner approach, but wanted to add you can select and copy those lines from Activity Monitor and paste them in a spreadsheet to analyze. You’d need to process/format out the MBs in the usage column. You could also use an app like Soulver that recognizes MBs as a unit and auto-adds up the numbers.

It’d be great if Activity Monitor summed anything you had selected in the footer.

2 Likes