Hi,

I observed a memory leak while using the RDKit to calculate descriptors for
a large library of compounds.

I tracked it down to the Ipc descriptor and it is reproducible with this
small script:

from rdkit.ML.Descriptors import MoleculeDescriptors
from rdkit import Chem

calculator = MoleculeDescriptors.MolecularDescriptorCalculator(['Ipc'])
for n in range(100000):
mol = Chem.MolFromSmiles('CC(C)Cc1ccc(cc1)C(C)C(=O)O')
x = calculator.CalcDescriptors(mol)
if not n % 100: print n

I tested it on my Linux workstation (Redhat 6). The process memory
consumption increases to several hundred mb. Interestingly, I can't
reproduce it on my Mac running the latest os.

My guess is that the leak is caused by getDistanceMatrix in MolOps.cpp.
Specifically, a missing delete for the distMat pointer (in the getDistanceMat
documentation is a note that the pointer should be deleted by the caller).
However, I am not a c++ programmer myself and this analysis might not be
the true cause.

I hope it is reproducible on other systems and easy to fix :-) If you need
additional information please let me know.

Best,
Michael
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to