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

MathGroup Archive 2011

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

Search the Archive

Re: Memory leak or flawed garbage collector

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120614] Re: Memory leak or flawed garbage collector
  • From: "Alexey Popkov" <lehin.p at gmail.com>
  • Date: Sun, 31 Jul 2011 07:25:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j0u7mo$fc1$1@smc.vnet.net> <j10l01$os6$1@smc.vnet.net>

"Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com> wrote:
news:j10l01$os6$1 at smc.vnet.net...
> Of course, it is quite possible that the references to your symbols
> responsible for their not being garbage-collected are somewhere other than
> the DownValues of In or Out, but if you find and remove these, you should
> find that the symbols are garbage-collected (unless for some reason they
> have had their Temporary attribute removed during the course of
> execution). If this does not occur after all references have been removed,
> then indeed a bug in the garbage collector would indeed be a possibility.

There is a bug in the garbage collector (non-removing unreferenced temporary
variables with their definitions):

In[1]:= $HistoryLength=0;
a[b_]:=Module[{c,d},d:=9;d/;b===1];
Length@Names[$Context<>"*"]

Out[3]= 6

In[4]:= lst=Table[a[1],{1000}];
Length@Names[$Context<>"*"]

Out[5]= 1007

In[6]:= lst=.
Length@Names[$Context<>"*"]

Out[7]= 1007

In[8]:= Definition@d$999

Out[8]= Attributes[d$999]={Temporary}

d$999:=9


This bug was originally reported in this MathGroup post:
http://forums.wolfram.com/mathgroup/archive/2010/Dec/msg00130.html





  • Prev by Date: In Version 8, Combinatorial&GraphTheory functions confuse me completely
  • Next by Date: Performance under Lion
  • Previous by thread: Re: Memory leak or flawed garbage collector
  • Next by thread: Re: Memory leak or flawed garbage collector