on 1/9/2001 9:00 AM, "ingo schuster" <[EMAIL PROTECTED]> wrote:
> Turbine stores RunData in the user's Session, and RunData holds references
> to the Request and the Response.
No. It does not!
RunData is STRICTLY a per instance instantiation.
Take a look at the top of Turbine.java doGet(). It is created for each and
every request by RunDataFactory. In fact, it is the very first line of real
code that is executed.
Please show me where you think it is being cached in the users session!
Also, this is documented in the javadoc for RunData.
> I think this is not good practise (as
> objects that are put in request or response will live until the user send
> his/her next request or until the sesion times out!).
I agree. That is why we don't do that.
> I suggest to release request and response just before the Turbine Servlet
> finishes the Request proceassing (see diff below)
>
> Index: Turbine.java
> ===================================================================
> finally
> {
> // Make sure to close the outputstream when we are done.
> + // and free the request and response so that they are not kept
> in the session
> try
> {
> data.getOut().close();
>
> + data.setRequest(null);
> + data.setResponse(null);
> }
> catch (Exception e)
> {
> // Ignore.
> }
> }
> }
-1. Not needed. This does absolutely nothing as the RunData object looses
all pointers to itself after the doGet() method is complete anyway.
> Another thing that doesn't seem wise to me (and the reason why holding the
> response in the session caused so much trouble to me) is that the
> TurbineJspService sets the response output buffer size to 2MB(!) unless a
> key is added in the TR.p. 2 MB is much more that the result of an average
> web page and so this increases the memory consumption significantly (2MB
> per concurrent user!). Wouldn't something like 8KB be more appropriate?
>
> ingo.
>
> Index: TurbineJspService.java
> ===================================================================
> /**
> * This method sets up the template cache.
> */
> private void initJsp(ServletConfig config)
> throws Exception
> {
> ServletContext context = config.getServletContext();
> Properties props = getProperties();
>
> path = props.getProperty("templates", "");
> /* not working properly - removing until I can investigate (jdm)
> if (path.startsWith("/"))
> {
> path = path.substring(1);
> }
> if (path.length() > 0 && !path.endsWith("/"))
> {
> path += "/";
> }
> */
> - bufferSize = Integer.parseInt(props.getProperty("buffer.size",
> "2000000"));
> + bufferSize = Integer.parseInt(props.getProperty("buffer.size",
> "8000"));
> }
>
> }
I'm +1 on this patch. But, I will let John make the call on it.
-jon
--
Honk if you love peace and quiet.
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]