Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From the command line, how would I get the total physical and virtual memory usage of a process and all of its descendants (not just 1st-level children)?

This is useful when you want to monitor the memory usage of applications that are not monolithic. For instance, Google Chrome spawns a whole bunch of workers and renderers, even though to the user, it's all in only one GUI window. Another example is Firefox, which has separate processes for its plugins.

The Activity Monitor application can display the processes in a hierarchy. But I find it not good enough, for two reasons:

  • It's not command-line;
  • It doesn't sum the numbers for me.
share|improve this question

If using third-party applications is a possibility, I would suggest that you install the htop process monitor, perhaps from Macports. This tool extends top with a nice layout, and most relevant for your use case, it has an arbitrarily deep thread tree view that can be turned on with the F5 key.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.