You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by David Morris <Da...@plumcreek.com> on 2004/03/24 17:15:51 UTC

Releasing resources

I am not sure whether this has been asked before but I noticed that the
JSTL tags like forEach can hold references long after completing their
task. Is this something that should be fixed? It seems like it would be
worth it (at least in my case) to set references null after iterating
through the underlying collection. I am not sure whether this is an
issue with the taglib (it does clean up when reset is called) or the tag
pooling implementation of Tomcat (4.1.27). What I am seeing is that in
some cases a tag is never reused causing the tag to hold references
until JSPDestroy is invoked when Tomcat is shut down.

Thanks,

David Morris

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


Re: Releasing resources

Posted by Martin Cooper <ma...@apache.org>.
On Wed, 24 Mar 2004, David Morris wrote:

> I am not sure whether this has been asked before but I noticed that the
> JSTL tags like forEach can hold references long after completing their
> task. Is this something that should be fixed? It seems like it would be
> worth it (at least in my case) to set references null after iterating
> through the underlying collection. I am not sure whether this is an
> issue with the taglib (it does clean up when reset is called) or the tag
> pooling implementation of Tomcat (4.1.27). What I am seeing is that in
> some cases a tag is never reused causing the tag to hold references
> until JSPDestroy is invoked when Tomcat is shut down.

If you're referring to things like a collection passed to the tag to
iterate over, then those references *must not* be set to null when the tag
is done. This is required for tag handler instance pooling to work,
because of the way AttSets work. Basically, the container is allowed to
remember the values it set on an instance, to avoid calling the setter
again with the same value. Modifying the attribute value within the tag
(e.g. by setting to null) would break that assumption.

--
Martin Cooper


>
> Thanks,
>
> David Morris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
>
>

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