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

Mike Muratet muratem at eng.uah.edu
Thu Dec 15 17:06:12 EST 2005

On Fri, 16 Dec 2005, Torsten Seemann wrote:

> Mike,
>> By commenting out various portions of the methods I have discovered that
>> the (a?) single offending line is is:
>> I'm off trying to understand why this keeps sucking up memory
>> ($polyn = $tempseq)  =~ s/^\w{$lcount}(\w)\w*$/$1/;
> You could try replacing those lines with:
> $polyn = $tempseq;
> my $minw = $lcount+1;
> if ($polyn =~ m/^\w{$minw,}$/) {
>  $polyn = substr($polyn, $lcount, 1);
> }
> and see if it chnages the behaviour?
> (And please correct my logic if it is wrong :-)

Thanks to Jason, Stefan and Torsen for the help.

I can't see anything wrong with the regular expression, either, except 
that it is inefficient as noted above and by Jason. I'll take the issue 
over to the perl lists and see if anybody has anything to say. In any 
event, Torsten's logic above is similar to that in a script I found by 
Google at stein.cshl.org as part of a perl course. It seems to me that you 
should be able to write a regular expression which would just find the 
longest repeat (because it's greedy) and I've seen some posts that do 
things like /(.)[^\1]+\1/ but I can't seem to get anything like this to 
work the way I expect or need. So, I'll use the loop to find the longest 



> --
> Torsten Seemann <torsten.seemann at infotech.monash.edu.au>
> Victorian Bioinformatics Consortium

More information about the Bioperl-l mailing list