Do not attempt to save variables after Octave crashes

551 views Asked by At

I am using Octave under Ubuntu. My Octave script has to make calculations with a big matrix, which I set the size. I want this matrix to be as large as possible within my memory requirements, so I do a few trials to use a reach a large enough matrix.

However, when I exceed the size, of course Ubuntu starts using Swap memory (which makes everything really sluggish) and at this point I want to cancel the script execution. But when I cancel, Octave tries to store my variables (which I dont want to). Below is a CTRL-C example:

^C
panic: Interrupt -- stopping myself...
^C
attempting to save variables to 'octave-workspace'...
^C
^C^C

This thing can take about half an hour to cancel.

So, the straight question is: how to avoid Octave to try to save the variables to the disk, and just quit instead?

2

There are 2 answers

0
carandraug On

There is a section of the Octave manual, named Saving Data on Unexpected Exits which tells you how to do it. You need to set crash_dumps_octave_core to false.

0
Dimitry On

There are also Octave Startup-Files, in which you can put the crash_dumps_octave_core(0) if you want that be default.

Also, there is a way to limit the amount of memory a particular process can use in unix.

Finally, there's ctrl-z which follows the kill order more strictly.