Turbine stores RunData in the user's Session, and RunData holds references 
to the Request and the Response. 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 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.
             }
         }
     }


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"));
     }

}



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to