Bug 50780 - AjpConnectionHandler keeps many connections causing memory leak
Summary: AjpConnectionHandler keeps many connections causing memory leak
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 7.0.6
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2011-02-15 04:51 UTC by Sergiusz
Modified: 2011-02-17 11:08 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Sergiusz 2011-02-15 04:51:49 UTC

Sorry for my english.

I use Tomcat 7.0.6 with APR 1.1.20. 

I noticed (from heap dump) many org.apache.tomcat.util.net.SocketWrapper objects, which are kept by "connections" atribute in org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler object. I don't understand, why there are so many objects representing old connections which are not active. In my example it was 300000 objects created, after 7 days of Tomcat work. Has someone forgotten to clean this HashMap from time to time?

best regards

Sergiusz Brzezinski
Comment 1 Mark Thomas 2011-02-15 12:17:05 UTC
This is Tomcat 7 specific Java code, not part of the APR native code.
Comment 2 Mark Thomas 2011-02-15 12:39:27 UTC
There was some clean-up in this area for 7.0.8. It is worth testing with the latest version to see if this has already been fixed.
Comment 3 Mark Thomas 2011-02-17 09:18:17 UTC
Yes it does still happen with 7.0.8 and is specific to the APR implementation of the AJP connector. Testing a fix now...
Comment 4 Mark Thomas 2011-02-17 11:08:23 UTC
This has been fixed in trunk and will be included in 7.0.9 onwards.