Re: How to free memory?
- To: mathgroup at smc.vnet.net
- Subject: [mg59776] Re: [mg59750] How to free memory?
- From: ggroup at sarj.ca
- Date: Sat, 20 Aug 2005 03:14:50 -0400 (EDT)
- References: <200508190832.EAA27549@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Fri, 19 Aug 2005 04:32:49 -0400 (EDT), Wonseok Shin wrote
> 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.
Pointers to solutions were posted in the "Garbage Collection" thread that has
been going on for the past few days.
> Let's do a small experiment.
> --------------------------------
<snip>
>
> In[6]:=
> data=.; Clear[data]; Remove[data];
> (* Tried all clearing methods that I know. *)
Did you try clearing the Out[n] history?
<snip>
> --------------------------------
> The only way to free the memory allocated to data
You can unprotect and clear the history cache. See the help browser and look
under the entry for Out[].
> is killing the kernel
> from the menu command "Kernel > Quit Kernel > Local".
You can quit the kernel with Quit[] as well...
> Is it really true that there is no way to free the memory?
If you don't need an infinite execution history to be accessible, why not
simply set $HistoryLength to something between 0 and 5?
Alternatively, you can reset $Line to something low so you overwrite the
history from that point on as you keep working.
You can also use the Share[] command to help optimize memory usage. This
optimization process can be further automated by loading the
Utilities`MemoryConserve` standard add-on package. See the help browser for
details.
<snip>
> How does Wolfram cope with this problem? I think there should
> be a solution!
I'm not sure you want to be using the following too liberally, but:
Block[{},
Unprotect[Out];
Table[Out[i] =., {i, $Line - 1}];
Protect[Out]];
- References:
- How to free memory?
- From: "Wonseok Shin" <wssaca@gmail.com>
- How to free memory?