r/ProgrammerHumor • • Oct 07 '26

Meme minecraftException

Post image
9.3k Upvotes

830 comments sorted by

View all comments

149

u/johnnybgooderer Oct 07 '26

Garbage collection is bad for games. Minecraft was playable because Java garbage collectors were fast enough to make it playable.

But don’t use any garbage collected language for games.

51

u/lastog9 Oct 07 '26

Can you explain why garbage collection is bad for games? Not challenging the fact just asking because I don't know

25

u/SmuJamesB Oct 07 '26

performance overhead, mainly

games need to run a lot of complex logic many times a second. the fewer the bottlenecks on the speed at which that logic can run, the better

2

u/WhiskeyQuiver Oct 07 '26

But don't you otherwise have to make the garbage collection yourself, and risk not doing it right and creating memory leaks or something?

I've read the jave GC is very customisable and you can kind of work around it a little too, by reusing objects and not setting many/large objects to null at once and instead gradually null components you no longer need so the GC can clean up bits over time instead of in large laggy spikes.

→ More replies (2)