1
$\begingroup$

I am doing some calculations that take up a lot of RAM. Sometimes, I do a short run, and then it either finishes naturally or I abort evaluation.

However, it seems like the RAM is still set aside for it, because in my task manager, it shows ~700MB of RAM still used as "system and compressed memory" (note: while not evaluating). I am fairly confident that it is Mathematica causing it, because it will be fine before I start MMa, then go up after I've done a few runs. I should note that Mathematica itself in the task manager is using a modest amount, ~100MB,

So, to try and "clear" everything, I'll do:

Quit[]
$HistoryLength = 0
Clear["Global`*"]

which, according to my limited knowledge, should release any RAM. (as an aside, probably just Quit[] by itself should do it, right?)

However, after doing this, "system and compressed memory" in my task manager is still very high. In fact, even closing Mathematica often doesn't change it.

Could this be a memory leak, or just something I'd doing carelessly?

I found this thread but I'm not sure how relevant it is.

$\endgroup$
  • 1
    $\begingroup$ Of course, this question is unanswerable without your actual code. Nevertheless, you may be interested in some techniques to identify memory leaks developed here: Debugging memory leaks. More generally, there are quite a few reports of functions leaking memory; perhaps a search of this site might bring up something relevant to your specific code. $\endgroup$ – MarcoB Jun 8 '16 at 0:09
  • $\begingroup$ Maybe this be helpful. $\endgroup$ – jack cilba Jun 22 '16 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.