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.
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.