MathGroup Archive 2005

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

Search the Archive

Re: Reducing memory footprint in use of FullSimplify ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56182] Re: Reducing memory footprint in use of FullSimplify ?
  • From: Madhusudan Singh <spammers-go-here at spam.invalid>
  • Date: Mon, 18 Apr 2005 03:08:41 -0400 (EDT)
  • References: <4261f768$0$79461$14726298@news.sunsite.dk> <1Dv8e.2568$J12.1938@newssvr14.news.prodigy.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Richard Fateman wrote:

> You may have found a bug in Mathematica where it
> is not reclaiming memory.  Perhaps you can write your
> intermediate expressions to files before the system
> crashes, and then re-load only the parts you need.
> 

Ok. Somehow I am not surprised. I moved from Mathematica 4.1 to 5.1 a few
days ago. And the frontend has been a little flaky, crashing every now and
then. Which has forced me to use the kernel alone (without the X frontend).

Is there a command that can make Mathematica flush memory that is lost
otherwise ?

> 
> It is probably a mistake to use FullSimplify for a lot
> of expressions, since that program can be very costly, and
> it is possible that it is, all by itself, on the last command,
> using too much memory.

No. I am using MemoryInUse[] to monitor the usage of memory after every
FullSimplify operation is over. This increases almost monotonically even
though the variable that it operates on is explicitly set to zero
(replacing a very long expression - something that should free up large
amounts of memory).

Let us say I have 

a=FullSimplify[b]

where b is a very long complicated expression and a is a less complicated
expression. Then the following operation :

b=0;
Print[MemoryInUse[]];

after the FullSimplify above, should free up memory(b)-memory(a)+1 (assuming
storing a zero takes one unit of memory) units of memory. However, I find
that the above number is negative (if MemoryInUse[] is to be believed) even
though it is pretty obvious that memory(b) > memory(a).

As you say, that memory should be freed up as soon as it is done. One more
wierd symptom I have noticed with version 5.1 is that if I interrupt a
running Mathematica kernel (quit kernel), an orphaned process named
aaa****** keeps running until I kill that separately using its PID.

I wonder what people at Wolfram have been upto.

>> Is there some way I can force Mathematica to free up memory on the data
>> stack (I am currently setting the unsimplified expression to zero as soon
>> as it is simplified and assigned to another variable) when it is done
>> with an element ?
> 
> What do you mean by data stack?
> 

Well, I was referring to the size of data in KB that I am allowed (ulimit).

> I assume you are setting expressions assigned to
> Out[] to zero,  or clearing them.

I am using $HistoryLength=0. Would that be equivalent ?


  • Prev by Date: Bug in UI?
  • Next by Date: Re: Re: Re: Infinite sum of gaussians
  • Previous by thread: Re: Bug in UI?
  • Next by thread: Re: Reducing memory footprint in use of FullSimplify ?