Skip Menu |

This queue is for tickets about the Tangram CPAN distribution.

Report information
The Basics
Id: 25145
Status: patched
Priority: 0/
Queue: Tangram

Owner: daveh [...]
Requestors: pt [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DK_POLICY_SIGNSOME
Received-SPF: neutral ( local policy)
Content-Type: multipart/mixed; boundary="------------000306060405090801020009"
Reply-To: pt [...]
Received: from ( []) by (Postfix) with SMTP id CCB724D80C7 for <bug-Tangram [...]>; Sun, 25 Feb 2007 18:44:19 -0500 (EST)
Received: (qmail 6032 invoked by alias); 25 Feb 2007 23:44:18 -0000
Received: from (HELO ( by (qpsmtpd/0.28) with ESMTP; Sun, 25 Feb 2007 15:44:16 -0800
Received: from [] ([]) (authenticated bits=0) by (8.13.8/8.13.8) with ESMTP id l1PNi7aN077929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-Tangram [...]>; Sun, 25 Feb 2007 15:44:09 -0800 (PST) (envelope-from pt [...]
Delivered-To: cpan-bug+tangram [...]
User-Agent: Thunderbird 2.0b2 (X11/20070116)
Subject: memory leak patch (Tangram/Schema/Node)
Return-Path: <pt [...]>
X-Original-To: bug-Tangram [...]
Date: Mon, 26 Feb 2007 01:44:00 +0200
Message-Id: <45E21F40.8010005 [...]>
To: via RT <bug-Tangram [...]>
From: Assen Tchorbadjiev <pt [...]>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 895
Download (untitled) / with headers
text/plain 895b
Hello, attached is a patch against the latest HEAD sources that resolves some memory leaks being reported due to unfreed closure(s) inside the for_conforming() & for_composing() routines. I think its save to free them this way since the methods are 'void' anyway. The memleaks can be caught with Devel::Leak (or more handy Apache::Leak). Attached is also an example script derived from t/musicstore/01-simple.t, that shows how to quick check the memleak difference. W/o the patch it reports about 488 leaks when selecting all CD::Artist types, whereas after the patch they drop to about 95. The example script has to be invoked after the 00-deploy & 01-simple have passed so it has any data to select. For example: # cd Tangram && make test # && abort after the musicstore/00,01 # copy 99-leaks.t to the t/musicstore # perl -It -Iblib/lib t/musicstore/99-leaks.t Regards, Assen
content-type: text/troff; name="99-leaks.t"
content-disposition: inline; filename="99-leaks.t"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
Content-Length: 708
Download 99-leaks.t
text/x-perl 708b
# -*- perl -*- # test script for the Persistathon - set TANGRAM_TRACE=1 in the # environment for a nice log of what queries Tangram is running. use lib "t/musicstore"; use Prerequisites; use strict; use Tangram::Storage; use Apache::Leak; # various items that will "persist" between test blocks use vars qw($storage); my ($oid, $id, $r_cd, $r_artist, $band, $row, $join, $filter); my $var; open FO, '>', \$var or die ($!); close STDERR; leak_test ( sub { $storage = DBConfig->dialect->connect(MusicStore->schema, DBConfig->cparm); $r_artist = $storage->remote("CD::Artist"); my @artists = $storage->select( $r_artist, ); $storage->disconnect(); }, undef, \*FO, ); close FO; print $var;
content-type: text/x-patch; name=""
content-disposition: inline; filename=""
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
Content-Length: 452
text/x-diff 452b
diff --git a/lib/Tangram/Schema/ b/lib/Tangram/Schema/ index 881fbd7..0218554 100644 --- a/lib/Tangram/Schema/ +++ b/lib/Tangram/Schema/ @@ -35,6 +35,7 @@ sub for_conforming }; $traverse->($class); + undef $traverse; } #--------------------------------------------------------------------- @@ -64,6 +65,7 @@ sub for_composing }; $traverse->($class); + undef $traverse; } sub get_exporter {

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to