[Not an Issue] memory / file.destroy()
cancerberoSgx opened this issue · comments
When interactively transforming several images without reloading the page I'm seeing (obviously) that RAM consumed by chrome increases until at some point the call to WASM will fail (TODO: print the exception).
exception thrown: abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 2136801280, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "). Build with -s ASSERTIONS=1 for more info.
Basically that one will load 4 big images and then try to execute a command with several intermediate images. It's failing.
I wander if we should provide a method to dispose/destroy the input and output files ? I'm almost sure the memory consumption is at the .html level not at the webworker's because there we are removing files but I think we should at some point analyse this problem
That's why I'm creating this issue and also I wanted to know your opinion
Thanks!
It should be noted that I do not move the objects when transferring between the web worker. When investigating this issue you may want to update all of the postMessage, https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage#Transfer_Example .
After some research this seems to be the expected behavior so I'm closing this.