Re: Odd memory behavior, and uncontrollable memory growth
- To: mathgroup at smc.vnet.net
- Subject: [mg40053] Re: [mg40019] Odd memory behavior, and uncontrollable memory growth
- From: Kirk Reinholtz <kirk.reinholtz at jpl.nasa.gov>
- Date: Mon, 17 Mar 2003 03:35:33 -0500 (EST)
- References: <200303160721.CAA02875@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
That looks like the classic Out[] syndrome: Each expression has its result appended to Out[]. The (...;1) saves less than the (...tmpFunk[10000]) because the "%" of the former is an int, the "%" of the latter is a big array (8bytes/double * 10,000 doubles, or something like that). nafod40 wrote: > > Hola, > > We are writing code where semi-complicated functions get run thousands > of times in packages. when we do this, we are getting memory use growth > that eventually drives the system to virtual memory, and severe speed > penalties. > > I have been trying to gain an understanding of this process, and came up > with the following odd example that makes no sense to me. Can someone > explain? > > a=MemoryInUse[]; > (q=tempFunk[10000];1); > d=MemoryInUse[]; > d-a > > The memory bumps up by 1080 bytes per iteration. It climbs, but slowly. > I figure that is justified by the In[] and Out[] storage. Now one small > change... > > a=MemoryInUse[]; > (q=tempFunk[10000];); > d=MemoryInUse[]; > d-a > > Now the memory jumps by 80,000 bytes per iteration! All I did was remove > the "1" from within the parentheses. What's up with that? I tried this... > > a=MemoryInUse[]; > (q=tempFunk[10000];); > q=1; > d=MemoryInUse[]; > d-a > > To force the clearing of 'q', still it jumps by leaps and bounds. Any > ideas why?
- References:
- Odd memory behavior, and uncontrollable memory growth
- From: nafod40 <may106@SPAMAWAY.psu.edu>
- Odd memory behavior, and uncontrollable memory growth