You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I know where it comes from. The validating plugin is doing a parseToString and the schema-validator a parseFromString. These artifacts are not being removed quick enough by the browser and pile up. After a while, the memory usage goes bananas.
You can check by:
Disable the auto-validate and make the same changes. The memory consumption should stay the same.
Just change one value, say in the Communication back and forth and see how the memory usage is rising.
Btw. I also found that the oscd-open plugin should be improved. When opening new file we are storing those is docs and never remove. When you open 10 different larger files you have easily 4 GB of usage.
After further testing, @JakobVogelsang and I noticed that a big part of the memory build-up comes just from plugins creating huge DOM trees (e.g. a list of all messages published or subscribed in the entire file) which are not garbage collected quickly enough after switching away from the editor plugin.
This is especially problematic because we currently re-render the full DOM tree every time we switch back to an editor plugin, meaning the plugin might have rendered all its content several times before a garbage collection cycle kicks in.
I propose we fix this by introducing a mechanism for keeping disabled editor plugins around in the background without updating their properties, so that they don't re-render until they become active again, and setting the inert global attribute so that a plugin can react by trimming its DOM tree while unneeded, so as to save on RAM while it's not in use.
Activity
danyill commentedon Nov 17, 2023
After two rounds with the same base file on Linux I am up to 406 Mb.
With three rounds I am up to 1.4 Gb.
In each round, I open each plugin (from left to right), make one small change or switch views and move to the next plugin.
JakobVogelsang commentedon Nov 17, 2023
This is pointing towards the schema validator running in an extra worker. I will try and reproduce your findings.
danyill commentedon Nov 18, 2023
I notice it does not happen if working in a single editor for a long time -- memory usage stays low and almost constant (92.7 Mb).
JakobVogelsang commentedon Nov 18, 2023
I think I know where it comes from. The
validatingplugin is doing aparseToStringand theschema-validatoraparseFromString. These artifacts are not being removed quick enough by the browser and pile up. After a while, the memory usage goes bananas.You can check by:
auto-validateand make the same changes. The memory consumption should stay the same.Communicationback and forth and see how the memory usage is rising.Btw. I also found that the
oscd-openplugin should be improved. When opening new file we are storing those isdocsand never remove. When you open 10 different larger files you have easily 4 GB of usage.ca-d commentedon Mar 19, 2024
After further testing, @JakobVogelsang and I noticed that a big part of the memory build-up comes just from plugins creating huge DOM trees (e.g. a list of all messages published or subscribed in the entire file) which are not garbage collected quickly enough after switching away from the editor plugin.
This is especially problematic because we currently re-render the full DOM tree every time we switch back to an editor plugin, meaning the plugin might have rendered all its content several times before a garbage collection cycle kicks in.
I propose we fix this by introducing a mechanism for keeping disabled editor plugins around in the background without updating their properties, so that they don't re-render until they become active again, and setting the
inertglobal attribute so that a plugin can react by trimming its DOM tree while unneeded, so as to save on RAM while it's not in use.