For a few days now I've noticed that the PID keeps going up quickly, at a rate of over 200 or so an hour.

I'd like to make a log entry of every process that starts (and quits) so I can figure out what is happening.

I've looked in the logs and with Activity Monitor but I haven't seen anything obvious.

Whatever is happening doesn't appear to stop the MBP from going to sleep though.

Currently using Mountain Lion 10.8.0 on a late 2008 MacBook Pro

  • Most likely, nothing unusual is going on. Just a bunch of little housekeeping tasks that need doing. Aug 22, 2012 at 15:37

1 Answer 1


There is a command execsnoop that you can run in a terminal window. Like so:

sudo execsnoop -v

A more detailed log of all that is going on requires a bit of dtrace hacking, as you need to track the fork and _exit system calls as well.

Edited to add a bit of explanation: Processes don't “start” on a unix system. New processes are created by the fork system call, which results in the calling process being split into two (almost) identical processes. One (the parent) keeps its PID, while the other (the childe) given a new PID. The most common reason for a fork is for the child to exec a new program; it's this fork+exec combination that you most commonly think of as a new process starting up. This is why you need to track three system calls (fork, exec, _exit) for the complete view. But just tracking exec, as execsnoop will do, seems sufficient for your purposes.

  • Sorry, didn't have time for more detail. Maybe someone else can supply some. Aug 22, 2012 at 14:53
  • Thanks, that seems to work for me. I've been running it for 20 minutes or so, and so far I've noticed that mdworker seem to be involved. It appears twice every minute or so, both with launchd as the parent with the owner being my user and _spotlight for the other. For most of the day the only open app has been Activity Monitor and in the past 20 minutes, Firefox. I've check the logs but I haven't seen any messages from mdworker or spotlight. Where should I look for logs for these?
    – D A
    Aug 22, 2012 at 16:09
  • I guess mdworker and spotlight don't log anything unless they run into trouble. That's the unix way, after all. ☺ Aug 22, 2012 at 22:14
  • This doesn't work anymore due to SIP. It's a shame macOS has broken so many system analysis tools over time.
    – Sagar
    Aug 9, 2022 at 4:17

You must log in to answer this question.

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