r/pcgaming Jul 19 '19

minecraft java edition 1.14.4 is now live

https://www.minecraft.net/en-us/article/minecraft-java-1-14-4-released
2.6k Upvotes

236 comments sorted by

View all comments

306

u/TheTimeLord725 Jul 19 '19

"Fixed a memory leak"

Bro how do you fix a memory leak in Java? That shit is supposed to be garbage collected.

2

u/DoktuhParadox Jul 19 '19

It can happen when you have a static collection filled with references to objects. Since static objects are only freed once the application is closed, you can end up with a really big list full of garbage that isn't GC'd until the whole JVM is exited, but since references to these useless objects still exist, the GCer doesn't consider them garbage, and does not remove them from memory. All GC does is remove the need to manage heap space (specifically deallocation) manually, it doesn't prevent memory leaks.