Maybe a better meme would be how processes see their memory space as contiguous but in reality the os may allocate chunks of discontinued memory to them
This was my first troubleshooting find when coding in the real world. They had created a class that allocated a bunch of memory every time a new object was initialized, but forgot to clean it all up in the destructor. It lasted in production for something close to a decade before the memory leak reared its head with a whole bunch of new threading that was in the newest release at the time.
That's the nice thing about memory allocation on Linux (and MacOS as well I think). As long as you don't touch the memory page, the OS won't actually give it to you
32
u/Not_a_penguin15 Oct 18 '26
Maybe a better meme would be how processes see their memory space as contiguous but in reality the os may allocate chunks of discontinued memory to them
95
u/Eddie_lol Oct 18 '26
My school projects working with memory
128
u/Paul_Robert_ Oct 18 '26
"Why call free() when you can just restart the computer" 🗣️🗣️🔥🔥🔥
2
u/frostyjack06 Oct 20 '26
This was my first troubleshooting find when coding in the real world. They had created a class that allocated a bunch of memory every time a new object was initialized, but forgot to clean it all up in the destructor. It lasted in production for something close to a decade before the memory leak reared its head with a whole bunch of new threading that was in the newest release at the time.
2
u/Vallee-152 Oct 18 '26
Who is How and why do they process images?
1
u/LetUsSpeakFreely Oct 19 '26
Everyone forgets about calloc()
1
u/TerryHarris408 Oct 20 '26
Always fun to do a
while(malloc(1));and watch the whole system choking
111
u/[deleted] Oct 18 '26
[removed] — view removed comment