Hi - I think I am seriously missing something here ...

That's my problem (talking tomcat 5.5.20 here)

Ingredients:

a) A business object (think it large) 
b) A Jsp tag which references the business object (i.e. spring message tag)
c) A Jsp page containing the tag

With default config tomcat will 

- create a TagHandlerPool instance which will cache the tag handler object
(b) in jsp init()
- release the TagHandlerPool in jsp destroy() which releases all cached tag
handlers (called when the corresponding JspServlet is destroyed with the web
app.

During execution of the jsp a tag handler instance is received from the
corresponding TagHandlerPool via tagHandler = get(Class<Tag>) and given back
via reuse(tagHandler). The tag is than cached in the pool. Note that release
is *NOT* generally called in reuse().

My problem is that I cannot come up with a way how the poor spring message
tag or any other tag could possible release its reference (by setting it to
null) after the page has been rendered. Other than implementing
TryCatchFinally and releasing them in finally. Yes you could do that but
none of the tags I've seen do that. Note that the spring tags don't even
bother to implement release and free their objects but that belongs on a
different mailing list.

Or as I strongly believe: I am totally missing something.

Also note that I have this problem with a webapp using silly amounts of
memory. My only way out was preventing the TagHandlerPool to cache at all by
configuring:

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>tagpoolMaxSize</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

  
-- 
View this message in context: 
http://www.nabble.com/TagHandlerPool-Memory-Problem-tp16002619p16002619.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to