Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Garbage collection and mutable data structures

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85645] Re: Garbage collection and mutable data structures
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Sun, 17 Feb 2008 07:19:20 -0500 (EST)
  • References: <fp67h9$5f6$1@smc.vnet.net>

Hi,

try
Information /@ Names["c$*"]

and find out where the reference to c$* is keept.

Regards
   Jens

massyah at gmail.com wrote:
> Hi MathGroup,
> 
> This snippet of code is giving me headaches:
> 
> -----
> $HistoryLength = 0;
> NewCell[i_] := Module[{c}, CellVal[c] ^= i; c]
> MemoryInUse[]
> NewCell /@ Range[10^5];
> MemoryInUse[]
> -----
> 
> It occurred while trying to build mutable data structures by using
> upvalues. I can't understand why the temporary variable c is not freed
> since I don't keep any reference to it.
> Have I missed something in the reference counting scheme ?
> 
> 
> Thanks in advance,
> Hayssam.
> 


  • Prev by Date: Question: Embed mathematica 3d in pdf?
  • Next by Date: Re: Sub-division of surface plotting by PlotPoints->{m,n}
  • Previous by thread: Re: Garbage collection and mutable data structures
  • Next by thread: Re: Garbage collection and mutable data structures