FREN

#FF00AA


31 may 2008

Find out what makes your Mac sluggish

For quite a while now I’ve had a problem on my iMac where, after a few days, launching any new application would result in the CPU gauge going to 100% for thirty seconds, and the temperature and fan speed rising accordingly — which wouldn’t have been so bad if I didn’t have a bunch of AppleScript applications that I regularly had to launch, or if I didn’t have to restart Safari every so often to reset resources.

I used to think the likely culprits were either Firefox 3 or Mercury Messenger, because it seemed to happen in a more reproducible way after I’d open them a couple of times (I won’t delve into the reasons why Firefox and Mercury are intrinsically associated in specific, uh, tasks), so I cut back on using one, or the other, or both — and today it started happening again even though I was certain I hadn’t used either since I last booted up. I went scrubbing my InputManagers folders again, as those are the prime suspects when something goes wrong with every application’s launch sequence, but there was still only 1Password, and removing it changed nothing. So I started thinking about alternate solutions, and suddenly remembered hearing about this Unixy thing that OS X has and I heard it lets you look at everything your computer does or something.

I googled a bit for the dtrace syntax; here is, for future reference, the Terminal instruction that did the trick:

sudo dtrace -n 'syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); }'

This tells dtrace to display in real time every file that’s being opened on disk; I looked at what was happening at the moment when the CPU went crazy, and I ended up removing the macam QuickTime component (which lets you use legacy USB webcams) and apparently solving the problem. I don’t know why a QuickTime component would start loading with every single program after a certain uptime delay, or why Mercury and/or Firefox would be accelerating that process, so I’m not 100% sure that I found the true root of the problem, but at the very least I did find a useful Unix comment, and hence this post.

Want to know when I post new content to my blog? It's a simple as registering for free to an RSS aggregator (Feedly, NewsBlur, Inoreader, …) and adding www.ff00aa.com to your feeds (or www.garoo.net if you want to subscribe to all my topics). We don't need newsletters, and we don't need Twitter; RSS still exists.

Monsieur M, 6 years ago:

La même chose en GUI : fseventer

garoo, 6 years ago:

Euh... Non ? Ce dont j'avais besoin, c'était de voir les fichiers ouverts, fseventer ne liste que les fichiers modifiés, non ? Je doute qu'un component QuickTime serait apparu dans la liste ?

louije, 6 years ago:

Ça semble une bonne solution, parce que c'est dynamique.

Sinon, pour d'autres usages, il y a toujours lsof (list open files), qu'on peut piper dans un grep (lsof | grep Safari, par exemple), ou dont on doit pouvoir traiter le résultat pour savoir quels sont les fichiers les plus ouverts. Ou l'onglet Fichiers ouverts de Moniteur d'activité.

Ah, et les apostrophes sont courbes dans ton bloc de code.

garoo, 6 years ago:

Oups, corrigé. Je crois.

Legal information: This blog is hosted par OVH, 2 rue Kellermann, 59100 Roubaix, France, www.ovhcloud.com.

Personal data about this blog's readers are not used nor transmitted to third-parties. Comment authors can request their deletion by e-mail.

All contents © the author or quoted under fair use.