Skip Menu |
 

This queue is for tickets about the Tangram CPAN distribution.

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

People
Owner: daveh [...] hodgkinson.org
Requestors: pt [...] tchorbadjiev.com
Cc:
AdminCc:

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 (x1.develooper.com: local policy)
Content-Type: multipart/mixed; boundary="------------000306060405090801020009"
Reply-To: pt [...] tchorbadjiev.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id CCB724D80C7 for <bug-Tangram [...] rt.cpan.org>; Sun, 25 Feb 2007 18:44:19 -0500 (EST)
Received: (qmail 6032 invoked by alias); 25 Feb 2007 23:44:18 -0000
Received: from pro34.abac.com (HELO pro34.abac.com) (66.226.64.35) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 25 Feb 2007 15:44:16 -0800
Received: from [172.16.72.6] ([89.190.216.6]) (authenticated bits=0) by pro34.abac.com (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 [...] rt.cpan.org>; Sun, 25 Feb 2007 15:44:09 -0800 (PST) (envelope-from pt [...] tchorbadjiev.com)
Delivered-To: cpan-bug+tangram [...] diesel.bestpractical.com
User-Agent: Thunderbird 2.0b2 (X11/20070116)
Subject: memory leak patch (Tangram/Schema/Node)
Return-Path: <pt [...] tchorbadjiev.com>
X-Original-To: bug-Tangram [...] rt.cpan.org
X-Spam-Check-BY: la.mx.develooper.com
Date: Mon, 26 Feb 2007 01:44:00 +0200
Message-Id: <45E21F40.8010005 [...] tchorbadjiev.com>
To: via RT <bug-Tangram [...] rt.cpan.org>
From: Assen Tchorbadjiev <pt [...] tchorbadjiev.com>
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 Node.pm 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="Node.pm.patch"
content-disposition: inline; filename="Node.pm.patch"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
Content-Length: 452
Download Node.pm.patch
text/x-diff 452b
diff --git a/lib/Tangram/Schema/Node.pm b/lib/Tangram/Schema/Node.pm index 881fbd7..0218554 100644 --- a/lib/Tangram/Schema/Node.pm +++ b/lib/Tangram/Schema/Node.pm @@ -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 Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.