Note: Mac OS X 10.4.9 seems to fix the bug described here.

pmTool, the process run by Activity Monitor to actually collect stats, appears to leak memory. If I leave Activity Monitor running for a good period of time, when I check up on it pmTool is often using over 100MiB of Real Memory.

I just checked my laptop, pmTool was using over 100MiB of Real Memory. Right now on my desktop it’s using 41MiB of Real Memory, but I don’t remember how long it’s been running for. I also believe a good deal of memory is currently paged out.

After checking up on it, pmTool on my desktop has a Private Memory size of 91MiB.

If I run leaks on pmTool on my desktop, I see 27931 leaks for 85799936 total leaked bytes, which works out to about 81.8MiB of leaked memory. All but 2 of these leaks appear to be blocks of memory of size 3072 that start with '?\0'.

In any case, this seems to be a pretty significant leak in pmTool.

A highly non-scientific test shows it to be adding one new leak every time the UI in Activity Monitor updates (default is every 2 seconds). So if you haven’t changed the update frequency then pmTool will leak 3KiB of memory every 2 seconds.

That’s a lot.

I haven’t noticed pmTool taking more than about 100MiB of Real Memory so far, but I never thought to check Private Memory until now so it may have simply been paging out a lot of leaks. If my calculations are correct, every 24 hours pmTool will have leaked 126.6MiB.

If you keep Activity Monitor running constantly like I do, you may want to check what your current memory usage is. If you see anything close to what I am, you may want to re-evaluate the importance of Activity Monitor (or set up a cron job to periodically restart Activity Monitor). On the other hand if you’re not seeing a leak problem I’d be interested to hear the details of your system (I’m currently running OS X 10.4.8). I’m not entirely certain whether this leak is Apple’s fault or whether one of the myriad customizations to my system is somehow causing this. As far as I know none of the hacks I use that inject into other code processes affect pmTool (seeing as how it’s not an AppKit application, so it doesn’t load Input Managers, and it’s run as root so it won’t be affected by anything that tries code injection), so this seems likely to be Apple’s fault, but if so I’m really surprised that they haven’t fixed it.

Update: I just checked the current memory usage of pmTool. I haven’t restarted it in at least a day, and yet it was listing a reasonable 1.2MiB of Real memory, and roughly the same Private Memory. This is the memory usage I’d want it to have, and yet completely different than the observed behaviour I documented in this post. I double-checked and the memory usage on my laptop was up to 55MiB. I wish I had thought of running leaks on pmTool when I saw this, but instead I quit and relaunched Activity Monitor, and immediately the leaky behaviour came back.

Update 2: I feel silly now. I completely forgot I’d set up a root crontab entry with @hourly killall pmTool to minimize the leak. That’s why it was showing such a small memory usage.

Update 3: I just got a brand new 2GHz Core 2 Duo MacBook, running 10.4.8 with the latest security update (i.e. the same OS as my iMac), and quite mysteriously, this leak isn’t showing itself. pmTool has a respectable 960KiB of Real memory usage, and no leaks. I can’t explain it.

30 Responses to “Activity Monitor leaks”
  1. I presume you’re reporting this to apple so it can be fixed, yes?

  2. Kevin Ballard says:

    Indeed I did report it after posting this entry.

  3. PMTool had allocated 1.2G on my system. It definitely has a memory leak.

  4. If you dont need the more advanced features of activity monitor and just want the application management features you might want to check out my App Stop application

    Sorry bout’ the self-promotion :P

  5. Kevin Ballard says:

    Mike, please don’t post 2 comments promoting the same app. When the second comes 15 minutes after the first, with a different body text and comment URL, I’m pretty sure that wasn’t a case of clicking Submit again because you didn’t think it went through.

  6. I am noticing this and it sucks! Have to ditch Activity Monitor I guess….

  7. Kevin Ballard says:

    ben: you could do what I did and set up an hourly cronjob (in the root crontab) to `killall pmTool`. Activity Monitor will restart it automatically.

  8. I have noticed my iMac G5 slowing down allot lately. I don’t run Activity Monitor often. However, when I start up Activity Monitor pmTool has been using up to 80-90% CPU. Which is how I found this post. Does pmTool run without Activity Monitor actually being running?

  9. Kevin Ballard says:

    No it doesn’t.

    And how on earth did you manage to post 9 duplicate comments?

  10. Just confirming that I see the memory leak as well. I run Activity Monitor contstantly and have to kill and restart it at least daily as it’s usually eating up about 150 MB to 200 MB of real mem.


  11. I’m using a macbook and this isin’t happening at all to me… I’ve been running activity monitor for atleast 24hours straight too. pmTool is showing 588kb of memory used.

  12. I always run Activity Monitor and it’s currently using only 1.68 MB of RAM.

    I have a MacBook Core 2 Duo w/1GB RAM running 10.4.8. Uptime reports the machine has been running for 15 days, and Activity Monitor has been running the entire time (it’s part of my startup items).

  13. Craig Hockenberry says:

    Try using iPulse instead:

    I’m the author and very careful about memory usage — I typically leave my copy of iPulse running for months at a time, so I don’t want to eat up RAM.


  14. Kevin O'Shea says:

    Useful info. But I’m not sure I can seriously listen to anyone who actually uses the term MiB.

  15. says:

    I have the Intel Core duo iMac running 10.4.8. My computer has been really really slow lately so I started Activity Monitor, pmtool was up to 130 MB within an hour. I shut it down and it started at 1.25 MB and its climbing steadily, already up to 1.9 MB. How do I stop this? I have no idea what an “hourly cronjob” is. I’m just a gi-be-nner at this (beginner). Thanks.

    Also, any idea what “kernel_task” is? Its also eating lots of memory 110 MB of real and 850 MB of Virtual.

    Thanks. Phil

  16. Running 10.4.8 on an intel core duo imac and i definately have the leak going on. I switched to half-second update intervals and I can sit and watch the real mem pmtool uses creaping up and up.

  17. Chris Oswald says:

    I have this problem on my Intel iMac CD also. 10.4.8, seems to be when the problem started.

  18. Kevin Ballard says:

    sharth: you on an intel computer? (i.e. actually on a MacBook, not a Powerbook)? Are you on OS 10.4.8? Chris Oswald just posited that 10.4.8 caused the problem.

    Ram Yoga: Check virtual memory (not that this number means much). I wonder if maybe you managed to get pmTool to page everything out right before you checked it. Alternately, for some reason pmTool just restarted. Or maybe, somehow, your system is special in that it doesn’t leak? Which would be quite odd..

    Craig: I think I tried iPulse 1 ages ago. In fact, I still have the serial number. But I stopped using it because I didn’t like it taking up the screen real-estate. But perhaps I’ll check out iPulse 2, see if it’s something I might want.

    Kevin O’Shea: You can’t take me seriously for using the more accurate term? o_O

    philsaudino: If you don’t know what a crontab is, perhaps you shouldn’t be messing around with it. There is a GUI app called CronniX which can edit your crontab for you, but I don’t know if it will edit the root crontab.

    Also, the kernel_task process isn’t actually a real process. Ignore the memory it claims to use – that’s all shared memory, i.e. any memory it’s claiming to use actually belongs to other processes.

  19. Kevin Ballard says:

    Ok Craig, I just looked, and while iPulse is pretty and quite functional, all I really want is a CPU history in my Dock, which I can click to get more information about. Basically, I want Activity Monitor, minus the leakage.

  20. says:

    Thank you Kevin!!

  21. Craig Armstead says:

    Well you guys I can with absolute certainty say that it has a memory leak.

    I run it from start up and it never gets shutdown.

    My system has been running for 6 days solid now and pmTool is using 900MB of RAM and 940MB of virtual.

    Has this been pointed out to Apple yet ?

  22. Kevin Ballard says:

    “Has this been pointed out to Apple yet ?”

    Yes, I opened a bug report, as I mentioned in the second comment.

  23. Jeremy says:

    Thanks for the very helpful info. I found your page via google after noticing that my pmTool had taken up about 740MB of RAM. Ironically, I was using Activity Monitor continuously to monitor my memory usage…

    BTW, I believe that cron is deprecated under Mac OS in favor of launchd; I’ve put instructions at for how to implement the effect of the cron job that way.

  24. Torsten Walter says:

    I can confirm the memory leak of pmtool also. I have it running for 10 minutes and memory usage doubled. I’m running 10.4.8. with all available updates installed on a Macbook Pro Core Duo.
    Another oddity I noticed since. is that all my apps use an insane amount of virtual ram. Everything thats run under the window server uses about 330MB Virt. Ram. Even the stickies widgets, each uses 2.84MB Ram and 338.96MB Virt. Ram. (Virt. Ram applies for all other widgets too) Odd…

  25. Hi, I can confirm that Apple appear to have fixed this bug. I just got a new MacBook Pro and it has an updated version of the OS not available for download yet (8.8.2 where my Mac mini is 8.8.1). pmtool on this new machine doesn’t appear to have the memory leak, so I presume has been fixed. I would guess the fix to this will come in the long awaited 10.4.9 release.

  26. yes, indeed

    Just upgraded to 10.4.9 on my MM CD and pmTool now stays at about 1MB, it seems.

  27. Has anyone else notice after the 10.4.9 update that the pmTool is using up about 60% of CPU Usage?
    Everything seemed fine at first but a few hours later pmTool was using 60-70%, after a restart everything seemed fine again, then a few hours later it started using a lot of CPU again…

  28. Kevin Ballard says:

    N. – haven’t seen that happen. You might want to try and get a sample of it doing that when it occurs (`sudo sample pmTool 5 10 -file $HOME/Desktop/pmTool.sample.txt`). Also, instead of restarting, try killing it (`sudo killall pmTool`).

  29. Argh, problem here too says:

    I hadn’t noticed PMTool’s memory usage, I must admit, but I do notice how much CPU time it takes up. On my Core Duo 2.0GHz, it can take up as much as 60% of one core — ludicrous for something that’s simply meant to be monitoring other threads. Freaking annoying.

  30. Booperkit says:

    Im having huge virtual memory leak on macbook pro with 10.4.10. upgraded to v.1.1 – nt improvement – should i try to g back down to 10.4.9 (i never had this as the macbook is only a few days old)