Hi all,

I have a web application - Servlets running in WebSphere BUT this question
could be for Java applications as well!

Components of my application use a log manager, which implements the
singleton instance pattern.  When a component wishes to log messages it
calls the log managers getInstance method, which returns the one and only
instance of the log manager class.

When I decide to shut down the web application each component has a finalize
method which sets the variable that contains the log manager instance to
null.

Now my understanding is that this is good practise since the garbage
collector will not clean up objects until all references (handles to it)
have been dropped.  So by getting each component to set its own variable
(that hows the log manager reference) to null I am speeding up the release
of memory.

Is this correct??

Best Regards

Marc

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to