continuous load test generate an error and the memory grows significantly #143
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@ShangChien thank you for your question, since the mol and qmol objects are c++ objects coming from the wasm module, you need to delete them explicitly and not only nullify them. See example here: See the emscripten reference here: If you still get the error after changing: qmol=null ;
mol=null; for qmol.delete();
qmol = null;
mol.delete();
mol = null; Let us know. Also, in my production code I have a small wrapper to avoid a double statement of deleting and nullifying all the time, like so: // it works for qmol too!
export const deleteMol = (mol) => {
if (mol) {
mol.delete();
mol = null;
}
}; Hope it helps. cc maybe @ptosco can comment further here |
Beta Was this translation helpful? Give feedback.
@ShangChien thank you for your question,
since the mol and qmol objects are c++ objects coming from the wasm module, you need to delete them explicitly and not only nullify them.
See example here:
https://github.com/rdkit/rdkit-js/blob/master/examples/react/src/components/MoleculeStructure/MoleculeStructure.js#L92
See the emscripten reference here:
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#memory-management
If you still get the error after changing:
for
Let us know. Also, in my production code I have a small wrapper to avoid a double statement of deleting and nullify…