[ensembl-dev] Memory leak in Compara?
Michael Paulini
mh6 at sanger.ac.uk
Thu Apr 21 10:29:45 BST 2011
I think most EnsEMBL-API DB adaptors have a caching layer ... which most
of the times, doesn't have a maximum size.
So it will grow over time (or leak more memory, depends on how you see
it) ... especially if you spawn of multiple adaptors to multiple
core-databases and iterate over the genes there.
M
On 20/04/2011 21:55, Alex Kalderimis wrote:
> 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
>
> _______________________________________________
> Dev mailing list Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
More information about the Dev
mailing list