MathGroup Archive 2001

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

Search the Archive

Re: Memory Conservation

  • To: mathgroup at
  • Subject: [mg29912] Re: Memory Conservation
  • From: "Orestis Vantzos" <atelesforos at>
  • Date: Wed, 18 Jul 2001 02:08:53 -0400 (EDT)
  • Organization: National Technical University of Athens, Greece
  • References: <9iomg8$i13$>
  • Sender: owner-wri-mathgroup at

a) The main difference between Module and Block is just that; Module removes
all local variables.
b) If you do remove finalanswer, you will get a Removed[finalanswer]
expression instead of the required result.
PS.If you want to save memory set $HistoryLength=0 before you use your
routine. Share[] helps too sometimes, but it will slow you down, if not used

"Shane Frasier" <jsf9k at> wrote in message
news:9iomg8$i13$1 at
> Hi,
>     I have a program in Mathematica that involves large matrices.  I want
> make sure that intermediate variables aren't wasting memory, so I have a
> questions:
> 1)  I have functions that look like
> Module[{i,j,final_answer},...Remove[i,j];final_answer].  Is Remove
> here, or do module variables cease to exist once the module ends?
> 2)  If it is necessary, is there any way to Remove final_answer too before
> the module ends?  In my case, the construction of final_answer is
> complicated, so I want to build it up in stages to avoid having a single,
> long and unreadable line of code.
> Thanks for your help,
> Shane Frasier
> jsf9k at

  • Prev by Date: Proof For Cov. Matrix equation?
  • Next by Date: Re: Exponents and notation
  • Previous by thread: Re: Memory Conservation
  • Next by thread: Re: Memory Conservation