MathGroup Archive 1999

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

Search the Archive

Memory bloat -- what have I done?

  • To: mathgroup at
  • Subject: [mg19219] Memory bloat -- what have I done?
  • From: "Aram Schiffman" <aram at>
  • Date: Tue, 10 Aug 1999 02:53:05 -0400
  • Organization: Posted via Supernews,
  • Sender: owner-wri-mathgroup at

Hi. Help?

I have this:

outOfHoleIndex = {};

If[MemberQ[inHoleIndex, #] === False, AppendTo[outOfHoleIndex, #],] & /@

inHoleIndex is an array of reals, inHoleIndex//Length is about 8000 or so.
Nums is just the counting numbers {1,2,3,...11875}.

I check MemoryInUse[] before and after, and get -- a difference of about 158
megabytes! Huge! What the hell am I doing wrong? If I do

Unprotect[Out]; Clear[Out]; Protect[Out];

Then I get most of that memory back. Also, if I rig the code so that MemberQ
is always True (i.e., never AppendTo outOfHoleIndex), this big chunk of
memory never gets moved. I guess I don't understand how AppendTo contributes
to Out, here, and more importantly, how to write my code correctly.



  • Prev by Date: Re: Equation Font
  • Next by Date: Re: Sort
  • Previous by thread: Re: Precision Problems
  • Next by thread: Re: Memory bloat -- what have I done?