2 ms·
I'd say even in Java, infinitely adding elements to a collection is not a memory leak, but merely forgetting that memory is finite. No Java programmer I know wo
by the_af 10y ago
I'd say even in Java, infinitely adding elements to a collection is not a memory leak, but merely forgetting that memory is finite. No Java programmer I know would call it a memory leak.
A leak is when you think you no longer hold references to an object, but you still do, and therefore the GC cannot free its memory. An example is the accepted answer in the StackOverflow link.