19 May 2010

Can Java have memory leak?

The answer is yes; and it is typically called unintentional object retention.
And this problem actually is not uncommon so that you need to understand what that is and how it could be prevented in your Java programs. Again this problem points out the peril of learning Java as your first and only programming language.
The solution is to NULL out obsolete references as soon as you are sure they will not be dereferenced ever again.

No comments: