You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling Chem.rdChemReactions.EnumerateLibrary in a loop increases the memory usage even if there are no future references to the EnumerationLibrary object.
To Reproduce
from rdkit import Chem
from rdkit.Chem import rdChemReactions
@profile
def run_once(rxn, mols):
library = Chem.rdChemReactions.EnumerateLibrary(rxn, [mols, ])
@profile
def run_10000(rxn, mols):
for _ in range(10000):
library = Chem.rdChemReactions.EnumerateLibrary(rxn, [mols, ])
rxn = rdChemReactions.ReactionFromSmarts("[C:1]-[C:2]>>[C:1].[C:2]")
mols = [Chem.MolFromSmarts("[C]-[C]")]*10000
run_once(rxn, mols)
run_10000(rxn, mols)
Expected behavior
I would expect the memory footprint of both functions to be the same, but they are not. Here is the output of running this code with memory_profiler:
python -m memory_profiler minimal_example.py
Line # Mem usage Increment Occurences Line Contents
The system monitor also shows an increased memory usage.
Configuration (please complete the following information):
RDKit version: 2020.09.3
OS: Ubuntu 18.04
Python version (if relevant): Python 3.8.2
Are you using conda? yes
If you are using conda, which channel did you install the rdkit from? conda-forge
Additional context
I have noticed this in a much more complicated piece of code, but this minimal example seems to reproduce the problem.
Thank you for any help!
The text was updated successfully, but these errors were encountered:
Describe the bug
Calling Chem.rdChemReactions.EnumerateLibrary in a loop increases the memory usage even if there are no future references to the EnumerationLibrary object.
To Reproduce
Expected behavior
I would expect the memory footprint of both functions to be the same, but they are not. Here is the output of running this code with memory_profiler:
Line # Mem usage Increment Occurences Line Contents
Filename: minimal_example.py
Line # Mem usage Increment Occurences Line Contents
The system monitor also shows an increased memory usage.
Configuration (please complete the following information):
Additional context
I have noticed this in a much more complicated piece of code, but this minimal example seems to reproduce the problem.
Thank you for any help!
The text was updated successfully, but these errors were encountered: