How do you handle memory leakage in java?

Answer:
Java has a fairly sophisticated garbage collection system, and in general you don't worry about memory leaks, as they only happen in a few very specific circumstances (notably, when adding listeners to Swing GUI objects and not removing them).

If you need more sophistcated memory management, java provides the clases in the java.lang.ref package.
Contributor: PaulMurrayCbr
First answer by PaulMurrayCbr. Last edit by PaulMurrayCbr. Contributor trust: 2 [recommend contributor recommended]. Question popularity: 1 [recommend question].