MathGroup Archive 2005

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

Search the Archive

Re: Memory Leak in Mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54723] Re: Memory Leak in Mathematica?
  • From: Peter Pein <petsie at arcor.de>
  • Date: Mon, 28 Feb 2005 03:27:11 -0500 (EST)
  • References: <cvhh4u$r6i$1@smc.vnet.net> <cvmi4f$3pg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

M.G. Bartlett wrote:
> John-
> 
> Thanks for the response.  I was not aware that SetDirectory[] placed
> the old values of the directory on a stack.  I tried your suggested
> change to the code; however, the memory issue persists.  The number of
> files I am working on is large, bug not unreasonably so (there are
> about 3500 data files that Mathematica is being asked to process with
> this code - it tends to quit on my machine after about 2800).
> 
> Any other ways I might be able to see which process within the code is
> consuming the memory?
> 
> Thanks for your suggestions...
> 
> Marshall Bartlett
> 
I've run a test on my computer with 3000 files, each containing 123x123
random reals. I observed a linear increasing need of memory using Map[].

So I tried
With[{len=Lebgth[currentFileNames},
  mem=Table[0,{len}];
  Do[
    processFile[currentFileNames[[i]]];
    mem[[i]]=MemoryInUse[],
  {i,len}]
];
ListPlot@mem

and you can see an almost constant need of memory (varying up- _and_
downwards).

hope, it helps

 Peter


-- 
Peter Pein
Berlin


  • Prev by Date: Re: Changing Plot Axis Displays
  • Next by Date: Re: Changing Plot Axis Displays
  • Previous by thread: Re: Memory Leak in Mathematica?
  • Next by thread: Controlling program flow across cells