james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: [jira] Commented: (JAMES-248) memory management - finalize/nullify after successful delivery of retrieved MailImpl
Date Thu, 08 Apr 2004 18:56:43 GMT
> does java not guarantee that everything will be garbage collected
> eventually? Even if that is not until program exit?

See: Runtime.runFinalizersOnExit().  There is no guarantee that finalizers
will be called, unless you use that deprecated and unreliable method.

I don't know if there is a guarantee that PhantomReference handling will
occur at JVM shutdown, either.  See Runtime.exit(int) for a description of
the exit sequence.  But there is also
Runtime.getRuntime().addShutdownHook(), and that could be used.

Martin Cooper raised the same concern, related to code that we are using in
Jakarta Commons.  I am looking at the code that I gave to Martin that uses
PhantomReferences, and see where a shutdown hook (JDK 1.3+) could apply.  It
should be able to process any remaining PhantomReference instances.

	--- Noel

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message