Development server memory skyrockets after changing shaders
I'm not sure if this actually classifies as a memory leak or just memory runaway with conflicting processes.
Reproduce
- Run
npm startto have the local server running - Open any
.glslfile under the Shaders directory - Modify and save that file
- Observe memory usage by
nodeskyrocket
My best guess is that the file watchers we have set up get stuck in a competing loop or something where they're repeatedly noticing changes, rebuilding the glsl -> js files, noticing JS changes -> rebuilding the JS -> triggering file changes in the shaders -> rebuilding -> repeat.
If this shows up as a hard crash (some out-of-memory error) eventually, then I also noticed this occasionally recently. It also happened to me ~"when editing GLSL files", but I wasn't able (or did allocate the time) to pinpoint it to a specific workflow.
@javagl if I notice it fast I usually kill it or Ctrl+C the process but if I don't then it does result in an OOM error. I assume it shouldn't be that hard of a fix I just also haven't spent any time digging into it yet
Edit: I also noticed this gets waay worse if you save multiple times in quick succession. It seems our glslToJavascript is slow and you can kick off multiple of these async processes that overlap