Garbage collection is Java’s mechanism to release the unused memory. In order to make the garbage collection more efficient we should release the object as soon as possible. One good practice to do this is to reduce the scope of the variable. If possible move statically scoped variables to instance based, instance based to local scope etc. If you can eliminate the variable itself, do it.
http://www.theserverside.com/tt/knowledgecenter/knowledgecenter.tss?l=NoObjectsLeftBehind
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment