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

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

closed as off-topic by Louis, MarcoB, m_goldberg, Jens, Yves Klett Jun 28 at 7:25

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – m_goldberg, Yves Klett
  • "The question is out of scope for this site. The answer to this question requires either advice from Wolfram support or the services of a professional consultant." – Louis, MarcoB, Jens
If this question can be reworded to fit the rules in the help center, please edit the 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

Browse other questions tagged or ask your own question.