Alex Rivera | Logout

Are memory leaks totally absent in Java applications?

Asked 2011-07-12T19:14:25.960
13

Possible Duplicate:
Creating a memory leak with Java

There is a "Garbage Collector" in Java, but does this mean that memory leaks are totally absent in a Java applications? If not, how and why do they happen?

I am more interested in scenarios in applications using JavaSE.

Edit
Report

1 Answer

2

Depends on how you define memory leak.

If you specifically mean having allocated memory that is no longer referenced by some memory root, then no, the garbage collector will eventually clean all of those up.

If you mean generally having your memory footprint grow without bound, that is easily possible. Just have some collection referenced by a static field and constantly added to.

answered 2011-07-12T19:25:22.143

Your Answer