DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41057>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41057

           Summary: Tomcat leaks memory on every request
           Product: Tomcat 5
           Version: 5.5.20
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


POST parameter values stay referenced by a static field in
org.apache.tomcat.util.buf.StringCache - thus the GC can never release the 
memory.

Steps to Reproduce:
1) install and start tomcat 5.5
(http://apache.zone-h.org/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.zip)

2) see the example webapp "Request Parameters Example" included in the install
(http://localhost:8080/servlets-examples/servlet/RequestParamExample)

3) run script "send.sh" to create heavy load
#!/bin/bash

export LEAK_COMMAND='curl --silent
http://localhost:8080/servlets-examples/servlet/RequestParamExample --output
response.htm --data @send.txt'

#create initial POST parameter with value about 10kB

echo "firstname=" > send.txt
for((i=0;$i<=10000;i=$(($i+1))));do
  echo -n "x" >> send.txt
done


#send the request
for((i=0;$i<=1000;i=$(($i+1))));do
  echo $i
  # modify the param value to send (append i)
  echo -n $i >> send.txt
  
  $LEAK_COMMAND

done

4) running the script causes heap usage to increase for some 40MB

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to