[Bioperl-l] Memory leak in Bio::Root::Root?

Mike Muratet muratem at eng.uah.edu
Tue Dec 13 11:32:32 EST 2005


Greetings all

I have a problem that surpasses what I know and what I've been able to 
glean from perltoot,perboot,etc. Maybe it's a question for a perl list, 
but here goes...

I was given a package that calculates some statistics regarding base 
repeats in a sequence. It inherits from Bio::Root::Root presumbably to 
obtain the exception behavior bestowed by the class judging from the 
perldocs and to enforce that the argument is a PrimarySeq object. It has
two methods which get called thus:

my $polyn = QStat->polyn($seq_obj);
my $nstat = QStat->nmer_stat($seq_obj);

where the returned values are scalar references. The problem is that 
script quickly uses up all of the 4GB address space (processing lots of 
oligos) and crashes.

I have used Devel::Size to determine the size of these variables and 
get 3.8K and 7K. I have tried to undef them at the end of the loop but it 
has no effect. I commented out the calls and the problem goes away so the 
problem is associated with the QStat object.

The QStat class has a constructor that calls the base constructor:
     my $self = $class->SUPER::new(@args);
would this demand a destructor somewhere?

Does calling a method out of a class like this invoke all the class 
machinery without creating the object with new?

Can someone with experience deriving from Bio::Root::Root offer some 
suggestions on how to get the memory back?

Thanks

Mike


More information about the Bioperl-l mailing list