Test::LeakTrace might have put me on the right track, and it looks like I can narrow it further down to KiokuDB:

use strict; use warnings; use Test::More; use Test::Exception; use Test::LeakTrace; use KiokuX::Model; my $model; eval { $model = KiokuX::Model->new(dsn => 'couchdb::uri=http://127.0.0 +.1:5984/lb-local'); }; plan skip_all => 'Cannot connect to CouchDB' if ($@); { no_leaks_ok { { my $scope = $model->new_scope; } } 'new_scope must not leak'; } done_testing;

gives me:

ot ok 1 - new_scope must not leak (leaks 2 <= 0) # Failed test 'new_scope must not leak (leaks 2 <= 0)' # at KiokuX_Model.t line 17. # '2' # <= # '0' # leaked SCALAR(0x4159810) from /usr/lib64/perl5/vendor_perl/5.12.4/Ki +okuDB/LiveObjects.pm line 191. # 190: # 191: $known->remove($scope); # 192: # SV = IV(0x4159808) at 0x4159810 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 0 # leaked ARRAY(0x4201180) from /usr/lib64/perl5/vendor_perl/5.12.4/Kio +kuDB/LiveObjects.pm line 260. # 259: # 260: $self->_known_scopes->insert($child); # 261: # SV = PVAV(0x4578968) at 0x4201180 # REFCNT = 2 # FLAGS = () # ARRAY = 0x4580b40 # FILL = 0 # MAX = 3 # ARYLEN = 0x0 # FLAGS = (REAL) # Elt No. 0 # SV = IV(0x4159808) at 0x4159810 # REFCNT = 1 # FLAGS = (IOK,pIOK) # IV = 0 1..1 # Looks like you failed 1 test of 1.

Valgrind also complained about something in Set::Object, so it might be the source of the problem. I'll keep digging.


In reply to Re^2: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB by parmus
in thread Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB by parmus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.