Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was running a simulation and everything went south (my fault, stupid coding error). So I quit the kernel. Everything was running very slowly, as if it were doing some kind of large calculation. Eventually I quit Mathematica. Everything continued to run slowly. So I opened up the terminal to see what processes are running (I'm on Mac OS 10.6.8, Mathematica 9.01) and observed that there was a "Mathkernel" process, using about half (and sometimes more - 57.2% in the sceenshot) of my CPU. I tried the "Kill" command, and even "sudo Kill" but it didn't even blink. I tried logging out and back in, but it was still there. Finally, I restarted my computer, and it was gone. My question: is there a more elegant way of recovering from such a runaway process?

enter image description here

share|improve this question
Use kill -9 43391 to force kill it. Could it be a leftover parallel kernel? – Szabolcs Apr 24 '13 at 17:02
Some 'fun' reading here. I always used to think -9 was "the ultimate kill weapon", but I'm not sure it's actually like that... – cormullion Apr 24 '13 at 17:10
That's great... kill -9 does the trick. (This is the second time it happened, and so I hadn't restarted yet. Now I don't need to). I stand humbled in my unix-ignorance. And thanks also cormullion -- interesting reading indeed. – bill s Apr 24 '13 at 17:15
this has happened to me a few times when I am using parallelization (just like Szabolcs mentioned). could this have been the case here too? – acl Apr 24 '13 at 17:17
I wasn't doing parallelization on purpose. It was a classic error: I intended to call one of the image processing functions with a real number but instead called it with a symbol. It churned and churned, and only after several minutes did I notice that it was "overdue." Then I quit the kernel and relaunched -- and went about my way... only noticing later on that everything was slow. – bill s Apr 24 '13 at 17:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.