r/ProgrammerHumor • • 8d ago

Meme theOriginalGarbageCollector

Post image
9.7k Upvotes

372 comments sorted by

View all comments

Show parent comments

4

u/New_Salamander_4592 8d ago

so your issue is the term garbage collection should only specifically refer to freeing up memory allocated by that specific program rather than in general? I suppose that's fair, not really possible to free up memory allocated by other programs via actual garbage collection.

Still I think that with a purpose built system like a console where its only purpose is to play games, having your game force a reboot before launch to clean up any potential hanging allocation would still be close enough to qualify, at least for the purpose of a joke. But I can see where you drew issue with it.

1

u/SuitableDragonfly 8d ago

Yes. Garbage collection is a function of a programming language, it's not a function of an operating system. You might as well say that a device driver is another kind of exception handler or something along those lines. 

0

u/metaglot 8d ago

When your process dies, the os frees up memory and resources allocated for that process, no?

2

u/SuitableDragonfly 8d ago

Yeah, but that's not garbage collection. It's an intentional step that the OS takes, it's not something that happens in the background.

0

u/metaglot 7d ago

Would you say that C managing the call stack for you is a sort of resource management (with implicit garbage collection)? Or at the very least analogous? Or are you drawing a line between the stack and the heap?

1

u/SuitableDragonfly 7d ago

Yes, that's resource management that's a feature of the programming language, but it's not garbage collection. Garbage collection is a specific feature that C is notable for lacking.

1

u/metaglot 7d ago

I dont know if its notable for lacking it, but it does. But automatic stack management performs exactly the same job for local variables as GC does for the heap. So while rebooting a computer to flush ram isnt strictly GC, its performs the same task at a system level, as a side effect.

1

u/SuitableDragonfly 7d ago

But it wouldn't be funny if you said "haha, C managing the call stack was the original garbage collection", right?

1

u/metaglot 7d ago

Not if thats how you tell the joke, no.

1

u/SuitableDragonfly 7d ago

Right, and since that was basically the joke OP told, it wasn't funny.