I have a Windows 10, fully updated, PC with 16GB RAM.
Yesterday I decided to clean my Recycle Bin; I have a backup program that versions files, and so the bin was cluttered with small copies of files that change daily. In the end, there were some 35,000 deleted files.
For starters, the behaviour of the Explorer window was really sluggish (say, a full minute to re-sort the file list, for example), and because I wanted to check that I didn't permanently delete some files I care about, I was deleting by groups of say some 5,000 files.
After deleting three groups, the OS displayed an "out of memory" message; it was not the usual "please close some programs" message, but in rather in this case the message said that the OS would start closing programs on its own. And, indeed, it "closed" Chrome (it actually killed it, as all history had been lost when I restarted it later). I checked with the Task Manager, and indeed Explorer was taking 15.9GB out of 16GB of RAM. Besides Chrome, a bit later the screens went black, came back briefly with lower resolution, and then came back with normal resolution but not recognizing the second monitor (i.e., the video driver crashed).
After restarting the system, everything went back to normal (with the exception of all the tabs and history in Chrome that were lost), but I'm curious about the operating system's behaviour in all of this.
Does it really make sense to Explorer to exhaust 16GB of RAM to deal with 35,000 files in the Recycle Bin? I do have folders with that many files, and they don't cause any trouble.
Shouldn't the OS have a mechanism to deny RAM to a program (even if it is an Explorer folder, which I have set up to launch on a separate process) instead of letting it crash the system?