MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to free memory?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59778] Re: How to free memory?
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sat, 20 Aug 2005 03:15:06 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 8/19/05 at 4:32 AM, wssaca at gmail.com (Wonseok Shin) wrote:

>First of all, I'm using Mathematica 5.1 for Mac.

>I searched this news group and saw that many of us are suffering
>from short of memory while using Mathematica, but I failed to find
>a solution.

>Let's do a small experiment

<details snipped>

Take a look at Section 2.14.1 in the Mathematica Book paying close attention to the discussion of $HistoryLength. Since by default, Mathematica stores all of your input and output in In and Out, simply clearing or removing specific expressions does not remove all instances of them.

You can clear the values saved in In and Out by doing

Unprotect[In,Out]
Clear[In,Out]

You can prevent Mathematica from storing things in In and Out by setting the value of $HistoryLength to 0.

Another useful utility is the CleanSlate package which can be found on MathSource. The function CleanSlate in this package restores things to the state they were in when the package was loaded. For example,

In[2]:=
data = Table[Random[], {10^6}]; 
MemoryInUse[]
CleanSlate[]; 
MemoryInUse[]

Out[3]=
21521400

Out[1]=
13519504

I find this utility so useful that I have it loaded automatically everytime Mathematica starts.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Re: Setting gridlines thickness in Plot
  • Next by Date: Weird Plot problem
  • Previous by thread: Re: How to free memory?
  • Next by thread: Re: How to free memory?