When opening my activity monitor, I have a zsh process taking all my CPU. Is it normal? I have iTerm and oh-my-zsh installed but I don't expect it as a normal behaviour.
Any idea?
When opening my activity monitor, I have a zsh process taking all my CPU. Is it normal? I have iTerm and oh-my-zsh installed but I don't expect it as a normal behaviour.
Any idea?
I encounter this problem a lot, too. It always involves installd
, and most importantly, with installd
installing/updating Apple apps, like iWork (IIRC it's iWork exclusive; at least I've yet to encounter an occurrence with a third party app).
I believe it has nothing to do with iTerm2 or oh-my-zsh (although I use both, too). What I believe is that this is a shell compatibility issue — Apple's installer script calls your default shell, probably
$SHELL -c command...
It was tested on bash
but not zsh
, so when zsh
gets called this way, subtle shell compatibility issues arise. When you inspect the offending process (Activity Monitor unfortunately, AFAIK, doesn't show you the full commands; I use htop
for this, and you may well use ps
or whatever), you will see things like
zsh -c defaults delete com.apple.helpd com.apple.helpd.sdmMapsCreated
which backs my guess (well, my guess was actually derived from these observations, to be precise).* Therefore, the solution is simply run the command yourself, in this case
defaults delete com.apple.helpd com.apple.helpd.sdmMapsCreated
Then you kill the offending processes. installd
automatically moves on (probably to the next stuck process like this). After multiple rounds of grinding you'll find the installation finished successfully. I know this is annoying, but this is the only way I found to work (reliably).
* It is actually beyond me how zsh -c
gets stuck on things like defaults delete
. Not sure if it's with my environment. (I've put GNU coreutils and alike in front of BSD stuff in my PATH, but I'm pretty sure I never messed with default
.) Maybe default
internally use BSD utils? But again, I can run the same command in my terminal with zsh, either interactively or non-interactively, just fine. This is really baffling (the solution above is not affected). Any input is welcome.
ps
tool just run ps uaxwww | grep zsh
then: 1. check for what's hogging the CPU; 2. execute it manually; 3. kill the process; 4. repeat
Mar 4, 2015 at 13:29
-c
compatibility analysis sounds right, though I can't understand either why that would get stuck, instead of just failing and returning. I'm trying to reproduce this myself. Where did you install the GNU coreutils from? And by any chance are you using a Homebrew or other non-default zsh
?
Jun 29, 2015 at 22:10
I regularly have the same issue and it's always related to the installd process, updating an AppStore application. Killing first installd and then the zsh process helps (but disables the AppStore's functionality until it's restarted).