[XML-SIG] XML code that creates cyclic garbage

Uche Ogbuji uogbuji@fourthought.com
Fri, 30 Jun 2000 10:04:53 -0600


> On Fri, Jun 30, 2000 at 11:37:28AM -0400, Jeremy Hylton wrote:
> >garbage collection scheme can not collect.  Can someone point me at
> >some example code that has this property?  I'd like to test the
> >garbage collector that is in Python 2.0.
> 
> I believe 4DOM uses cyclical references, and requires that you always
> call a .releaseNode() method to break the cycles.  So, you could just
> try running 4DOM and never calling .releaseNode(); with the GC, it
> shouldn't leak.  The old PyDOM code tried to avoid creating cycles, so
> it wouldn't make any garbage to be collected (modulo bugs).

Yes.  You can simply take any of the 4DOM demos, replace the ReleaseNode calls 
with a del of the corresponding root node, and check that all memory was 
reclaimed.

-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +01 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python