The Mathematica Journal
Download This Issue
Feature Articles
Graphics Gallery
Tricks of the Trade
In and Out
The Mathematica Programmer
New Products
New Publications
News Bulletins
Editor's Pick
Write Us
About the Journal
Staff and Contributors
Back Issues

Memory Management

Q: Consider the following session. Check to see how much memory is in use.
Load in a data file.
Check to see how much memory is presently in use.
Clear the expression which was assigned when the data was loaded.
Again check to see how much memory is presently in use.
Since I have cleared the expression, why has the memory use not gone down?
A: David Withoff ( answers: If the memory associated with the value of data is not recovered, this means that the value may still be in use. Here the value of data is being used in a value of Out. You can recover that memory by clearing Out or by unsetting the appropriate value of Out, as in:
If there are still other references to the value of data, these would need to be cleared as well.
If you want to locate all references to an expression, you can track down references using methods such as
which reports all of the symbols that include references to the expression data. This sort of thing is rarely necessary, though. In most cases, it is not difficult to find references just by looking at a program, or to set up your program so that unwanted references are not introduced in the first place.

Converted by Mathematica      September 29, 1999 [Prev Page][Next Page]