Q: Consider the following session. Checkto 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 (firstname.lastname@example.org) 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]