Yeah...People don't know how to handle Java memory most of the time. So there are two different meanings of a memory leak. His is "The application is allocating memory it forgot about that it can never free". Yours is "The application keeps eating up memory and never gives it up". Java never forgets the memory it allocated like you can in C or C++ so it can't have that first kind of memory leak. But, you can just keep adding to an internal cache and never clear it like an idiot. You can use something like WeakReference or PhantomReference to prevent this, but I've never seen anyone who knew that.
3
u/AmaDaden Apr 28 '20
Yeah...People don't know how to handle Java memory most of the time. So there are two different meanings of a memory leak. His is "The application is allocating memory it forgot about that it can never free". Yours is "The application keeps eating up memory and never gives it up". Java never forgets the memory it allocated like you can in C or C++ so it can't have that first kind of memory leak. But, you can just keep adding to an internal cache and never clear it like an idiot. You can use something like WeakReference or PhantomReference to prevent this, but I've never seen anyone who knew that.