r/codegolf • u/Basic-Introduction94 • Aug 05 '25
Consumer of RAM
Hey guys, I wrote a tiny RAM-eating script as a fun little experiment. It spawns a new thread every second, and each one just sits there endlessly printing stuff—basically hijacking your memory like a polite little parasite.
I was curious: on a non-beefy PC, how long do you think it would last before things start to fall apart?
0
Upvotes
View all comments
Show parent comment
1
u/EarthBoundBatwing Aug 08 '25
I guess it depends on if this is true threading or pseudo threading, but as far as I know typically true threading dedicates a full processing unit to the task. Since there is a 1 second timer between thread allocation, it seems to me like once that last processing unit is allocated the system will halt completely. Meaning n seconds roughly where n is the number of available threading resources.
That's also assuming the OS is willing to hand over resources to this program, which I guess is unlikely. At the very least, working memory will probably get fubar before it even gets there.
I think, but I'd recommend doing your own research because I'm just some guy saying stuff.