tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: svn commit: r645722 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
Date Tue, 08 Apr 2008 23:10:21 GMT
just taking a quick look at the patch, this is a memory leak.
the buffer will simply grow larger and larger until an OOM happens, if 
one keeps marking the buffer
when I am more awake, I'll help out on this, it's very easy to reproduce
http://people.apache.org/~fhanik/upload-mark.jsp

Filip

markt@apache.org wrote:
> Author: markt
> Date: Mon Apr  7 15:47:54 2008
> New Revision: 645722
>
> URL: http://svn.apache.org/viewvc?rev=645722&view=rev
> Log:
> All of the issues I was seeing with mark/reset were due to states that resulted in a
call to CharChunk.flushBuffer().
> I tried many different ways to fix it but by far the simplest was this patch that just
increases the size of the CharChunk internal buffer when creating the mark sufficiently that
flushBuffer() is never called.
> With this patch I can't break mark/reset with bug 44494's test case in single or multibyte
mode.
>
> Modified:
>     tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
>
> Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=645722&r1=645721&r2=645722&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original)
> +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Mon Apr  7 15:47:54
2008
> @@ -457,11 +457,7 @@
>                  cb.setOffset(0);
>              }
>          }
> -        int offset = readAheadLimit;
> -        if (offset < size) {
> -            offset = size;
> -        }
> -        cb.setLimit(cb.getStart() + offset);
> +        cb.setLimit(cb.getStart() + readAheadLimit + size);
>          markPos = cb.getStart();
>      }
>  
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   


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


Mime
View raw message