[ensembl-dev] Memory leak in Compara?

Alex Kalderimis alex at flymine.org
Wed Apr 20 21:55:20 BST 2011


I'm trying to download homology information using the Perl EnsEMBL API, and 
have encountered a memory leak in one of the DB adaptors (or that is what it 
seems to be - I've encountered similar things before and I'm aware that other 
posts have been made to this list regarding similar things.)

The code I'm trying to run is:

	foreach my $homologue_info (@$homologues) {
            my $gene_list = $homologue_info->gene_list();
            while ( my $member = shift @{$gene_list} ) { 
                my $taxon_id = $member->taxon_id;
                my $gene = $member->get_Gene();
                my $stable_id = $gene->stable_id;
    
                my $dblinks = $gene->get_all_DBLinks('Entrez%');
                my @symbols;
                my @secondaryIdentifiers;
                while ( my $dbentry = shift @{$dblinks} ) { 
                    push @symbols, $dbentry->display_id;
                    push @secondaryIdentifiers, $dbentry->primary_id;
                }   
                my $symbol = join('|', uniq(@symbols));
                my $sec_id = join('|', uniq(@secondaryIdentifiers));

                $out->print(join("\t", $taxon_id, $stable_id, $symbol, 
$sec_id), "\n");
            }   
        }   

Where $homologues refers to:
  my $homologues = $homology->fetch_all_by_MethodLinkSpeciesSet($species_set);

And $homology is an adaptor obtained thus:

 my $homology = Bio::EnsEMBL::Registry 
>get_adaptor('Multi','compara','Homology')
        or throw DownloadError => "Cannot get homology adaptor";

Any thoughts or suggestions would be greatly appreciated,

Alex Kalderimis
Software Developer
InterMine
University of Cambridge




More information about the Dev mailing list