[Biopython-dev] [Bug 3010] New: Bio.KDTree is leaking memory

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Feb 12 08:30:12 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=3010

           Summary: Bio.KDTree is leaking memory
           Product: Biopython
           Version: 1.53
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: krother at rubor.de


When I run KDTree on several of our PCs (Ubuntu, one with BioPython 1.53, one
with 1.51), it consumes memory that is never freed unless the process
terminates.

The code below fills 1GB memory within about a minute.

----
#!/usr/bin/env python

from Bio.KDTree.KDTree import *
from numpy.random import random

nr_points=1000
dim=3
bucket_size=10
coords=(200*random((nr_points, dim)))

while True:
   kdtree=KDTree(dim, bucket_size)
   kdtree.set_coords(coords)

----

Running the GC doesn't help (via del kdtree; gc.collect() in the while loop)
does not help.

I think the problem might be the C code or the Python/C interaction. I checked
the sources of KDTree superficially (to see whether there is a free() for each
malloc(), but did not see anything unusual (am not a C programmer though).

Peter proposed using valgrind to check memory leaks in C. Eventually it is
applicable to the problem.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list