How can I manage memory usage while plotting 3D functions in Mathematica?

In summary, the individual is attempting to plot 3D functions in Mathematica but is experiencing issues with increasing RAM usage. They have tried using ClearAll and ClearSystemCache[], but these solutions did not work. They are new to Mathematica and using version 8. Suggestions given include buying more RAM, setting $HistoryLength to a modest value, and setting swap space to be the same amount as memory. It is also noted that using memory is not necessarily a bad thing and the individual should aim for 75% memory usage with a peak of 180% with swapping. Additionally, if the machine is crashing with these calculations, the individual should address the underlying issue with the machine.
  • #1
Curl
758
0
I'm trying to plot some 3D functions in mathematica, but each time I evaluate the cell, more and more RAM gets eaten up.

How do I clear the memory to keep this resonable? My PC almost crashed because I ate up all the memory. I tried ClearAll and ClearSystemCache[] and it didn't work.

I'm new with Mathematica. Also I am using version 8

thanks
 
Physics news on Phys.org
  • #3
Try setting $HistoryLength to a modest value if you absolutely have to.

http://reference.wolfram.com/mathematica/ref/$HistoryLength.html

And as Greg said, having more memory than anyone tells you is reasonable will serve you well with Mathematica. 16Gig might be a reasonable amount today, only because we still don't see many boards that will accept 32 or 64 yet.

Set your swap space to be about the same amount as your memory and when Mathematica starts hammering the drive with swapping that is a clue you need to start paying attention to the calculation sizes.

Using memory is a good thing, not a bad thing, if memory isn't mostly committed to a task it is serving no purpose. Aim for perhaps 75% being used by Mathematica and peak at 180% with swapping.

If the machine is going to crash with that then figure out what is wrong with the machine and fix that.
 

Related to How can I manage memory usage while plotting 3D functions in Mathematica?

1. What is "Flushing RAM" in Mathematica?

"Flushing RAM" in Mathematica refers to the process of freeing up memory space in the computer's random access memory (RAM) that is being used by Mathematica. This can help improve the performance of Mathematica by clearing out unnecessary data and making more space available for current calculations.

2. Why would I need to flush RAM in Mathematica?

If you are working with large datasets or performing complex calculations in Mathematica, it is possible that the program may use up a significant amount of RAM. This can lead to slower performance or even crashes. Flushing RAM can help prevent this by freeing up space for current calculations.

3. How do I flush RAM in Mathematica?

To flush RAM in Mathematica, you can use the ClearSystemCache[] function. This will clear out all cached data and free up memory space. You can also use the Clear[variable] function to specifically clear out the data stored in a particular variable.

4. Will flushing RAM delete any of my work in Mathematica?

No, flushing RAM in Mathematica will not delete any of your work. It will only clear out data that is stored in memory and is not currently being used. Your saved files and calculations will not be affected.

5. How often should I flush RAM in Mathematica?

This will depend on your specific usage of Mathematica and the amount of RAM available on your computer. If you notice that your program is running slower or encountering errors due to limited memory, it may be a good idea to flush RAM more frequently. Otherwise, you can flush RAM periodically or when you notice a decrease in performance.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
9K
Back
Top