Hi Adam,
You need to delete the molecule once you’re done with it. It is beyond the
reach of the JS garbage collector.  Add ‘mol.delete()’ at the end of the
loop to free the memory for the next round.
HTH,
Dave


On Tue, 25 Jan 2022 at 20:46, Ádám Baróthi <barothi.a...@gmail.com> wrote:

> Hello everyone,
>
> I'm currently experimenting with the Javascript wrapper for RDKit,
> thinking that I could offload image generation and descriptor calculations
> to the client.
> I have a list of 1555 SMILES right now that I'm trying to convert to mol
> objects with RDKit.get_mol(), but after successfully processing about
> 700-800 molecules I get an "abort(OOM)" exception. Any further calls to
> get_mol() throw the same exception. The code is fairly basic:
>
> molecules = []
> for (smi,idx of smiles_list.entries()) {
>     mol = RDKit.get_mol(smi);
>     //image = mol.get_svg();
>     //descriptors = JSON.parse(mol.get_descriptors());
>     //molecules[idx] = {'image': image, 'desc': descriptors};
> }
>
> With this, I could process about 830 molecules.
> If I uncomment the lines, I could process about 700.
>
> I'm fairly new to JS development, so I'm not really sure what I'm doing
> wrong.
>
> Best,
> Adam
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
-- 
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to