My understanding is that Java does not have memory leaks. By memory leak, I mean memory that you cannot access anymore (not memory that you could, but you don't). Here is an example in C: https://en.wikipedia.org/wiki/Memory_leak#A_simple_example_in_C
A friend linked me to these two articles:
- https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/memleaks001.html
- https://www.toptal.com/java/hunting-memory-leaks-in-java
However, I do not see any indication that Java is actually leaking memory, just there is programmer error such as:
- storing too much unnecessary data (like a list that you keep appending to)
- not enough memory altogether (and need more RAM/heap space)
- native code doesn't manage its memory correctly
- not closing native resources such as streams or databases
- potentially a bug in the JVM that needs to be fixed
He also mentioned cyclic references, but I believe Java deals with these as well because of its tracing garbage collector.
Am I correct in this? Other than the issues I listed, does Java have any "true" memory leaks?