I\'m doing some rather long computations, which can easily span a few days. In the course of these computations, sometimes Mathematica will run out of memory. To this end, I\'ve
Have you tried to evaluate $HistoryLength=0;
in all subkernels and as well as in the master kernel? History tracking is the most common source for going out of memory.
Have you tried do not use slow and memory-consuming Export
and use fast and efficient Put
instead?
It is not clear from your post where you evaluate ClearSystemCache[]
- in the master kernel or in subkernels? It looks like you evaluate it in the master kernel only. Try to evaluate it in all subkernels too before each iteration.