[Biopython-dev] Benchmarking PDBParser

Peter Cock p.j.a.cock at googlemail.com
Fri May 6 08:29:19 UTC 2011


On Fri, May 6, 2011 at 9:24 AM, João Rodrigues <anaryin at gmail.com> wrote:
>> Memory bloat is bad - it sounds like a garbage collection problem.
>> Are you recreating the parser object each time?
>
> No. I'm just calling get_structure at each step of the for loop. It's a bit
> irregular also, sometimes it drops from 1GB to 300MB, stays stable for a
> while and then spikes again. My guess is that all the data structures
> holding the parser structures consume quite a lot and probably there's no
> decent GC to clear the previous structure in time, so it accumulates.
>

You could do an explicit clear once per PDB file to test this hypothesis:

import gc
gc.collect()

Peter




More information about the Biopython-dev mailing list