I am a new user running Julia 1.8.3 on WSL2. I am installing the Plots package by running pkg> add Plots. The installation runs until partway through precompilation, then my computer crashes with a BSOD error code: MEMORY_MANAGEMENT. I have been able to reproduce this twice. The first time something must have corrupted during the crash, as I couldn’t precompile anything – error message along the lines of “EOFError: read end of file” (I no longer have the entire error message, apologies!).
When I tried to install Plots again after removing ~.julia, my PC once again crashed with error MEMORY_MANAGEMENT. I tried running pkg> add Plots again, and it was successful.
Has anyone experienced this behaviour before? I’m not sure whether the memory problem is a WSL issue or a Julia one, and I wasn’t able to find helpful information on google. I’ve been using the same WSL setup for a while (mostly compiling C++ codes), and have never had my PC crash because of it.
A modern non-administrator program, especially one “sandboxed” like when running from WSL2 should really not be able to cause BSOD. Therefore here is my speculation: Plots is a pretty big package that requires a ton of compilation when installing that might have used most of your RAM, making any issues with RAM defects much more probable to surface. On the julia end of things, some settings to be less aggressive with RAM usage would be nice (features like that are being added); you can also run with a single thread when installing packages to make sure that there are not too many things compiling in parallel, eating up all your RAM (I have had this problem with older version of Julia and DifferentialEquations). On the memory side of things, you can run a memory test to check for defects. It seems Windows 10 has a built-in “Windows Memory Diagnostics” tool you can try.
All of this makes sense only if you were actually running low on RAM and your RAM had rare intermittent issues.
Try setting ENV["JULIA_NUM_PRECOMPILE_TASKS"] = 1 before trying to precompile Plots. This will be slow since Julia will be precompiling packages one at a time, but it may reduce memory pressure.
No matter what Julia or Plots do your computer shouldn’t crash unless you have faulty hardware (likely) or there is some kernel bug that is hit (unlikely).
I would run a memory test to ensure that one of yiur RAM sticks haven’t gone bad.