Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 169

Questions about RAM usage, including optimizing memory use, avoiding and fixing leaks and releasing unused memory.

15 votes
Accepted

How to force Mathematica to clean up the cache

The idea is to run the memory leaking code in an extra kernel and restart that kernel every once in a while. … Here is a simple example based on your minimal working example which demonstrates the idea and shows that the master kernel will not accumulate any memory: LaunchKernels[1]; Print[MemoryInUse[]]; calcsPerKernel …
Albert Retey's user avatar
  • 23.6k
8 votes

Does parallel programming use up large quantities of memory in Mathematica?

I have put some code in between the different parts so that you can check that the memory consumption is really what I am claiming (or see if that's not the case for you, which I can of course not exclude …
Albert Retey's user avatar
  • 23.6k
2 votes

Is it possible to force ParallelDo to periodically close and launch subkernels?

Here is some code, not very elegant but should work and hopefully is easy enough to understand so that it probably is good enough as a starting point: numkernels = 2; numcalculations = 10; maxcalcsper …
Albert Retey's user avatar
  • 23.6k
7 votes

Memory Problem with Modules and NDSolve

It is a little known fact and probably not well documented, but since version 9 one can use just strings as variables (dependent and independent) in NDSolve, which in this case helps to solve the memory … For me this function does not leak any variables anymore and I think should be free of memory leaks as well. …
Albert Retey's user avatar
  • 23.6k
3 votes

Notebook cells space on disk profiler

The code below does not exactly what you have asked for, but it should contain the relevant stuff. To create an index ordered by cell sizes I think it would be easiest to set CreateCellID to True for …
Albert Retey's user avatar
  • 23.6k
9 votes
Accepted

Notebook cells space on disk profiler

Note that the code which adds and removes the cell tags does copy the complete content of the notebook into kernel memory, which might fail for huge notebooks. … While that would be more memory efficient, it might be much slower. …
Albert Retey's user avatar
  • 23.6k