As with anything, you can set them to null just to be safe - if you do
that, the GC *may* get them sooner than if you don't.
If you don't set them to null, they'll remain referenced by the
containing object and not be collectible until the containing objects
are destroyed by the GC, which is kind of indeterminable. :-)
Larry
On 10/5/07, Tom Henricksen <[EMAIL PROTECTED]> wrote:
>
> We have an application that has a ServletContextListener that creates three
> SqlMapClients in the contextInitialized. When the application is shutting
> down(in the contextDestroyed) should we just null out those SqlMapClient or
> does it matter.
>
>
>
> Called from the contextDestroyed
>
>
>
> public static void stopService() {
>
> //Get ready for garbage collection
>
> singleton = null;
>
> reportingClientSingleton = null;
>
> nestedTransactionSingleton = null;
>
> }
>
>
>
> We have some memory leaks from our Websphere production environment and I
> just want tidy things up.
>
>
>
> Thanks,
>
>
>
> Tom Henricksen
> Consultant
> Advanced Technologies Group, Inc.