[gt-users] memory leak in create_from_ptr
Gordon Gremme
gremme at gmail.com
Thu Apr 9 14:42:08 CEST 2009
>> hi, here's a simpler test case:
>>
>> ######
>> import gt
>> f = gt.FeatureNode('1', 'CDS', 123, 234, '+')
>> while True:
>> g = gt.FeatureNode.create_from_ptr(f.gn, newref=False)
>> ######
>
> Thanks, I have found and fixed the problem. The problem was that on each
> FeatureNode creation (even when wrapping identical pointers), a
> temporary dict was created as a cache for the attribute iterator, which
> led to excessive memory usage. This is now deferred until it is actually
> used and then discarded, as is the CFuncType object used to fill it.
>
> I have also introduced a slight interface change to the FeatureNode
> class. Please use the FeatureNode.create_new() constructor class method
> to create a new feature node instead of the standard constructor. This
> made the class much simpler to read and understand. See my 'fixes'
> branch ob github for details. Is this ok with you?
I just rebased the 'fixes' branch and pulled it into the master.
Thanks,
Gordon
More information about the gt-users
mailing list