Is a memory leak supposed to be able to crash the system?

50 points agr3as 44 comments

I was testing with a apparent bug where I would import a DLL as an extension to a game engine and that DLL would have a memory leak and eventually crash the game but taskmgr won't show memory usage increase in the process. I rewrote the DLL in C++ (including the now fixed memory leak) and taskmgr shows the memory usage increasing until the crash as expected. To further investigate this issue, thinking it could be exclusive to Rust programs, I wrote a MRE (which is just allocating in a loop) and observed the memory usage in task manager. Again, memory usage won't increase for some reason but after a few seconds my system crashed. The screen turned black for some time until I was presented with the Windows login screen like if I did a logoff. I tried the same program in another computer and the result is the same. Is this supposed to happen? Shouldn't the allocation fail after some time? Even if the system is overcommitting I don't touch any allocated pages. Obviously if you run the playground it will abort with `SIGKILL` but if you want to try this in your Windows machine make sure to save all your work prior.