Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

Sometimes I'll have a loop that I accidentally made too big. I'll evaluate, and MM will try to run through the entire loop. The program itself doesn't actually seem frozen... I can go to Evaluation-> Abort/Interrupt evaluation, but they don't do anything. I can even save while it's doing this!

What seems to kind of work is saving, closing the file, and then going to Evaluation->Quit kernel.

But that's a little ridiculous. Is there really no 'hard kill'?

Thank you!

share|improve this question
If the spin is "tight", it can take some time before MM responds to a kill, if at all. Try putting TimeConstrained around your test cases or put in some explicit guard until you're sure they are peachy. – ciao Feb 25 '14 at 5:59
Okay, but I'm curious: what's the logic behind designing it like this? I'd understand if it wanted to give literally all its resources to computing the code, but it's clearly checking for things like mouse clicks, menu openings, saving, etc. So why not just have something that really kills it? – YungHummmma Feb 25 '14 at 6:30
Sometimes it works to repeatedly abort the evaluation (on my mac with shortcut cmd+.), it has happened to me before that I was able to kill the evaluation only after hitting the abort shortcut 8 times or so. Maybe it's a matter of killing sub processes individually? – freddieknets Feb 25 '14 at 7:46
On Windows you can still kill MathKernel.exe in the task manager, it always works :D – Öskå Feb 25 '14 at 10:32
@YungHummmma As you noticed, usually you can kill the kernel instantly by Evaluation -> Quit. But then you lose all kernel state (definitions made so far, etc.) Interrupting an evaluation while maintaining a clean kernel state is not an easy task at all. If you extend Mathematica through C you need to explicitly make your C functions interruptable, i.e. periodically check for an abort and exit from the function in a clean way, ... – Szabolcs Feb 25 '14 at 12:37

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.