in reply to Re: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB
in thread Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Weird memory leak in Catalyst application using Catalyst::Model::KiokuDB
by parmus (Novice) on Aug 02, 2011 at 18:08 UTC |