Mathematica beeps and clears all variables

I am writing a code which is supposed to simulate the heat transfer. All the time, when I run the code Mathematica starts computations, and after some time beeps and clears out all variables. If I for example add Print["A"] somewhere it does the same, but in a different moment of computations than previously. What can cause the problem? Shouldn’t Mathematica print some error first? Is this normal behaviour of Mathematica? I’ve been using it for 5 years, but this is the first kind of big program.