[Zope] memory leak in a very simple product. Way?

Christoph Wierling wierling@molgen.mpg.de
Wed, 16 Jan 2002 17:31:30 +0100 (MET)


On Wed, 16 Jan 2002, Thomas B. Passin wrote:

> [Christoph Wierling]
>
> [me]
> > > I think you really want to do this:
> > >
> > >          tree = []
> > >          for i in xrange(200):
> > >              n = item(str(i),i)
> > >              tree.append(n)
> > >          self._tree = tree
> > >
> >
> > Thanks for the suggestion. Your code does about the same as my did -
> > it also reproduces the 20000 references to objects of the item-class.
> > And I also don't get rid of the 20000 references. I tried it!  :-(
> >
>
> I was about to ask if your item() objects are persistent, when I read Chris
> McDonough's post.  If you are storing al 20,000 items, no wonder you see
> memory uasge increasing.

Yes, the item() objects are persistent. And if I do recursive creation and
deletion of the objects which contains the list with the persistent item()
objects the references to the item objects are still growing.
I just made the item objects not persistent, and it seems to work, so no
growing references.

So I wonder way the reference counter for persistent item objects is still
growing by the recursive process of creation and deletion.

christoph