Reaction mapping memory leak

12 views
Skip to first unread message

Daniel Lowe

unread,
Jun 28, 2011, 11:31:21 AM6/28/11
to indigo-bugs
IndigoObject reaction = indigo.createReaction();
reaction.addProduct(indigo.loadMolecule("[Au]"));
reaction.addReactant(indigo.loadMolecule("OC(=O)C=C"));
reaction.addReactant(indigo.loadMolecule("OC(=O)CC(=C)C(O)=O"));
reaction.addReactant(indigo.loadMolecule("C(C=C)N"));
reaction.addReactant(indigo.loadMolecule("C(=C)CCC(=O)O"));
reaction.addReactant(indigo.loadMolecule("C(=C)S(=O)(=O)O"));
reaction.addReactant(indigo.loadMolecule("C(=CC1=CC=CC=C1)S(=O)
(=O)O"));
reaction.addReactant(indigo.loadMolecule("S(=O)(=O)(O)C=C"));
reaction.addReactant(indigo.loadMolecule("[O-]C(=O)C=C"));
reaction.addReactant(indigo.loadMolecule("S(=O)(=O)(O)CC=C"));
reaction.addReactant(indigo.loadMolecule("[O-]C(=O)C=C"));
reaction.addReactant(indigo.loadMolecule("[O-]C(=O)C=C"));
reaction.automap("discard");

causes all the system's memory to be used up and after a while
"array: reserve(): no memory" to be displayed.

Obviously this is not an actual reaction; I am actually intending to
use the result of the mapping as a heuristic which would indicate that
this is not a valid reaction.

I think the memory leak is connected to the number of reactants.

Savelyev Alexander

unread,
Jun 29, 2011, 4:33:32 AM6/29/11
to indigo-bugs
Hi Daniel
Thank you for the bug report. The bug was fixed. The new version will
be available in the upcoming indigo release.
It was not actually a memory leak. The AAM algorithm was trying to
calculate all reactants permutations thus the "no memory" exception
was raised.

Daniel Lowe

unread,
Jun 29, 2011, 6:18:18 AM6/29/11
to indigo-bugs
Is this a change in behaviour? Previously the algorithm seemed to be
matching reactants sequentially which in the case of a reaction with
only 1 product would make the problem only order N.
If every permutation does need to be considered i.e. the problem is N!
then throwing an exception if there are too many reactants/products
and AAM is performed could be an answer although this form of AAM
should probably not be the default.

On Jun 29, 9:33 am, Savelyev Alexander <asavel...@ggasoftware.com>
wrote:

Savelyev Alexander

unread,
Jun 29, 2011, 7:08:18 AM6/29/11
to indigo-bugs
This is not a change in behaviour. The upper bound for permutations
was added only. The algorithm uses permutations to calculate all
possible maps and chooses the best one. So, the fix may affect only
difficult reactions with a large reactants number. This is not a
reason to throw an exception in our opinion. But such a solution with
raising errors may be added in the future (for example, optional)
Reply all
Reply to author
Forward
0 new messages