On computers that have small amounts of installed memory, Mathematica's performance will begin to suffer after carrying out many memory-intensive calculations. This package optimizes Mathematica's use of memory by automatically executing the kernel command Share[ ] whenever memory usage increases by a specified amount.
Share[ ] tries to minimize the memory used to store all expressions by sharing the storage of common subexpressions between different parts of an expression, or different expressions. Using Share[ ] will never affect the results you get from Mathematica. It may, however, reduce the amount of memory used, and in many cases also the amount of time taken. Note, however, that the Share[ ] command itself may take some time to run.
Commands for memory conservation.
This loads the package.
When memory usage has increased by $MemoryIncrement bytes Share[ ] will be run automatically.
This generates a large list containing multiple copies of the same expression.
As you do subsequent calculations, Share[ ] is called and a significant amount of memory is freed up. The amount freed will vary from one computer system to another.
MemoryConserve::"start": "Running Share to conserve memory."
MemoryConserve::"end": "Finished running Share; \!\(924320\) bytes of memory freed."
This stops automatic memory conservation.
This restarts automatic memory conservation.