WebAssembly is out of memory
with multiple modules on one page
#3162
-
I have a SPA (using Vue.js, so no page loads where the VerovioModule will reset) in which I use
My setup:
I am not sure whether my setup is not optimal, the verovio toolkit destroy is not working as expected, or this feature needs some improvements in verovio. Is it wrong to create a new module for each score instance? When I try to use a single module for all instances then I get back wrong scores because the module is not aware of the current state passed with ReproductionI have setup a reproduction repository without web worker: https://github.com/WolfgangDrescher/verovio-out-of-memory Click "Load 10 scores" button until you get the error |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
Are you creating a new toolkit for every score? The best way, if you're using a web worker, is to treat the web worker as a "server" that hosts a single toolkit. Then it's up to you to clear / reinitialize the Verovio state with every score load. You send a message to the "server" with a score data to render, and it responds with some SVG. |
Beta Was this translation helpful? Give feedback.
-
Each instance has a fixed (or at least minimum) size of 250 MB. So 25 instances would be 6.25 GB, which is why you are running out of memory. If the 25 segments are short, then you should definitely use the method that @ahankinson mentions: one instance that produces 25 segments. |
Beta Was this translation helpful? Give feedback.
-
You probably avoid that by using |
Beta Was this translation helpful? Give feedback.
-
Is the parallel use of multiple toolkit/module instance at once something we could improve in verovio, or is this one of the limitations we have because of emscripten? |
Beta Was this translation helpful? Give feedback.
Each instance has a fixed (or at least minimum) size of 250 MB. So 25 instances would be 6.25 GB, which is why you are running out of memory. If the 25 segments are short, then you should definitely use the method that @ahankinson mentions: one instance that produces 25 segments.