# Why is my Mathematica notebook resetting all my previous computations after some hours?

I am using Mathematica 11.1. This morning I started some calculations in the hope that when I come back from work, they will be finished and I can get on with the rest of my project. Indeed, when I got home the computations were finished, and I could see the results.

However, as soon as I attempted to use those results, stored within a variable, my variable got "un-set", i.e., it turned blue and querying its value just returned an undefined new variable.

This happened many times before when the difference between one computation and the next was several hours.

Is there anything I can do to prevent this behaviour? For obvious reasons, it is very annoying.

• This means your kernel crashed. What caused it to crash? We cannot say without a reproducible example. If the reproducible example takes all day to run it will be hard to diagnose. – ktm Dec 17 '18 at 19:42
• Thank you for your comment. Indeed, I was performing a computation requiring a lot of CPU power and memory. How do I know it crashed? There is no error report, nothing at all, just a reset of all my variables... – Klangen Dec 17 '18 at 20:05
• Hard to say how to avoid this. Of course, efficient programming can help a lot. Moreover, it may be a good strategy to write intermediate results to disk. For example with Export or DumpSave. – Henrik Schumacher Dec 17 '18 at 20:12
• One possibility (among many) is that you are running out of memory. If this is the problem you can set the \$HistoryLength variable to something reasonable (the default of Infinity sometimes seems less than reasonable). – bill s Dec 17 '18 at 20:57