I want to profile the execution of a program to see what in particular is slowing it down - whether it hits a memory cap or if my CPU is not powerful enough.

Activity Monitor (the one that comes with OS X) is great, but I don't think it can record data (i.e. I think you can only see current RAM and CPU usage, not usage from the past).

I want the usage broken down by process if possible, so I can control for other things spiking in usage.

Do you know of any application that has this functionality?

  • 2
    If this is an app you're developing, take a look at Xcode's Instruments tool to profile this kind of thing. – Nathan Greenstein Sep 22 '12 at 17:52
  • No, I'm not developing this app - it's third party. I am trying to figure out if buying more RAM will fix the problem, or if I just have a slow CPU... – Daniel Kats Sep 22 '12 at 19:17

To see if CPU or memory is the issue you might start with iostat and vm_stat You would run these from a Terminal.

To get it to continually record you need to run it as

iostat n

where n is the number of seconds between executions.

If you need to look at memory usage then you would want

vm_stat n

If you want to get information on a particular program then you would probably need to write a script that called something like

ps wwaux | grep your_program_name 

over and over.

| improve this answer | |

You may want to look into OS Track. It's not the most stable and reliable app but free and I think it should do the things you need. To find our more you can check the screenshots on the developer's site.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .