Re:Re: Clear value of pre calculated expresion
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1702] Re:[mg1491] Re: [mg1438] Clear value of pre calculated expresion
- From: mvyver at ecel.uwa.edu.au (Mark Van de Vyver)
- Date: Mon, 17 Jul 1995 03:54:30 -0400
Hi Mathgroup,
When running some simulations in mma2.2 under WFWorkgroups 3.11 and/or unix
I find that the memory (real and virtual) fills up....for large sims this
happens quite fast. Clear[] and Remove[] provided no joy. Since I'm using
some 3rd party packages I was ready to put the blame on them and postponed a
fix. Now, having seen the msgs below I'm wondering if the problem is that
mma is remembering the prior sim. results and calculations. Is this
possible? does anyone have anything to add to what Dave Wagner says (ie this
caching can't be overcome)?
The sim is in the following form (there is no screen output):
K=20
Do[ function[k]'s;
Write[]'s;
clear[]'s;
etc, { k, K} ]
Thanks for any help.
Cheers
Mark Van de Vyver
THE INCLUDED MESSAGES:
In article <3rqk54$hs3 at news0.cybernetics.net>,
John Fultz <jfultz at wri.com> wrote:
>> I would like to clear value of pre calculated expresion which Mathematica
>> save in memory. When you do
>>
>> N[Pi,23]
>>
>> Mathematica would calculated number Pi on 23 places and save that value in
>> work memory for future calculations, but some times ( test and simulation )
>> is nice to dont that ... so my question is how clear that type of data from
>> working memory ?
>>
>> Dubravko Penezic
>
>You can do this by evaluating the following lines:
>
>Unprotect[In,Out]
>Clear[In,Out]
>
>This will clear the whole command history up to the current evaluation.
>
>John Fultz
>Wolfram Research, Inc.
I don't think that's what Mr. Penezic was talking about. The kernel
caches the numerical values of things that have been evaluated for some
time, e.g.:
In[1]:=
N[Pi,1000]; // Timing
Out[1]=
{0.216667 Second, Null}
In[2]:=
N[Pi,1000]; // Timing
Out[2]=
{0. Second, Null}
At some point in the distant future, this computation will require .217
seconds again, but there's no (known) way to predict when or to force it to
forget the cached answer. Clearing In/Out has no effect on this.
Except for benchmarking Mathematica itself, I'm not sure why one would
want to clear the cached values, but I think that's the question
being asked.
Dave Wagner
Principia Consulting
(303) 786-8371
dbwagner at princon.com
http://www.princon.com/princon
Mark Van de Vyver
#############################################################################
# #
# Department of Accounting and Finance Phone: (61) (09) 380-2510 #
# University of Western Australia Fax: (61) (09) 380-1047 #
# Nedlands 6907 e-mail: mvyver at ecel.uwa.edu.au #
# Perth #
# #
#############################################################################