You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2005/12/20 18:02:37 UTC

svn commit: r358036 - in /tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime: BodyContentImpl.java JspFactoryImpl.java

Author: remm
Date: Tue Dec 20 09:02:33 2005
New Revision: 358036

URL: http://svn.apache.org/viewcvs?rev=358036&view=rev
Log:
- Add two system properties (as given the JSP API, there is no easy solution to
  retrieve configuration parameters elsewhere) to allow configuring Jasper
  memory management. Note that changing from the defaults may affect
  performance, depending on the application.

Modified:
    tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
    tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java

Modified: tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java?rev=358036&r1=358035&r2=358036&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java (original)
+++ tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/BodyContentImpl.java Tue Dec 20 09:02:33 2005
@@ -40,6 +40,8 @@
     
     private static final String LINE_SEPARATOR = 
         System.getProperty("line.separator");
+    private static final boolean LIMIT_BUFFER = 
+        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "false"));
     
     private char[] cb;
     private int nextChar;
@@ -468,6 +470,10 @@
             throw new IOException();
         } else {
             nextChar = 0;
+            if (LIMIT_BUFFER && (cb.length > Constants.DEFAULT_TAG_BUFFER_SIZE)) {
+                bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE;
+                cb = new char[bufferSize];
+            }
         }
     }
     

Modified: tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java
URL: http://svn.apache.org/viewcvs/tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java?rev=358036&r1=358035&r2=358036&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java (original)
+++ tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime/JspFactoryImpl.java Tue Dec 20 09:02:33 2005
@@ -40,9 +40,10 @@
     private Log log = LogFactory.getLog(JspFactoryImpl.class);
 
     private static final String SPEC_VERSION = "2.0";
-    private static final boolean USE_POOL = true;
+    private static final boolean USE_POOL = 
+        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL", "true"));
 
-    private SimplePool pool = new SimplePool( 100 );
+    private SimplePool pool = new SimplePool(100);
     
     public PageContext getPageContext(Servlet servlet,
 				      ServletRequest request,
@@ -51,7 +52,6 @@
                                       boolean needsSession,
 				      int bufferSize,
                                       boolean autoflush) {
-
 	if( System.getSecurityManager() != null ) {
 	    PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
 		(JspFactoryImpl)this, servlet, request, response, errorPageURL,



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


Re: svn commit: r358036 - in /tomcat/jasper/tc5.5.x/jasper2/src/share/org/apache/jasper/runtime: BodyContentImpl.java JspFactoryImpl.java

Posted by Tino Schwarze <ti...@tisc.de>.
Hi there,

On Tue, Dec 20, 2005 at 05:02:37PM -0000, remm@apache.org wrote:
> Author: remm
> Date: Tue Dec 20 09:02:33 2005
> New Revision: 358036
> 
> URL: http://svn.apache.org/viewcvs?rev=358036&view=rev
> Log:
> - Add two system properties (as given the JSP API, there is no easy solution to
>   retrieve configuration parameters elsewhere) to allow configuring Jasper
>   memory management. Note that changing from the defaults may affect
>   performance, depending on the application.

[...]
> +    private static final boolean LIMIT_BUFFER = 
> +        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "false"));
[...]
> +            if (LIMIT_BUFFER && (cb.length > Constants.DEFAULT_TAG_BUFFER_SIZE)) {
> +                bufferSize = Constants.DEFAULT_TAG_BUFFER_SIZE;
> +                cb = new char[bufferSize];
[...]
> +    private static final boolean USE_POOL = 
> +        Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL", "true"));

Thanks a lot! This gives people nice adjusting screws.

Bye, Tino.


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