tomcat connection pool leak problem: Cannot get a connection, pool exhausted

2011-05-04  来源:本站原创  分类:Java  人气:215 

1 Problem Description
Web programs running in the tomcat fast start, but after some time that very slowly.
Check the log output, abnormal as follows:

org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause:
java.util.NoSuchElementException: Timeout waiting for idle object

2 problem solving
tomcat data source definition provides three arguments:
a. If set to true then the re-use tomcat automatically check recovery, does not shut down the Connection. (The default is false)

<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>

b. Set the number of seconds connected to be considered is to abandon the connection, you can use for recovery.

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>

c. output recovery log, you can print out the exception details to discover a leak in there

<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>

Associated with spring configuration parameter interpretation BasicDataSource
An initial connection
initialSize = 10

Maximum idle connection 2
maxIdle = 20

3 Minimum Idle Connection
minIdle = 5

4 maximum number of connections
maxActive = 50

5 out whether the automatic recovery of connection timeout errors when printing connection
logAbandoned = true

Whether the automatic connection recovery timeout 6
removeAbandoned = true

7 timeout (in seconds)
removeAbandonedTimeout = 180

8 timeout wait time in milliseconds 6000 milliseconds / 1000 is equal to 60 seconds
maxWait = 1000

相关文章
  • tomcat connection pool leak problem: Cannot get a connection, pool exhausted 2011-05-04

    1 Problem Description Web programs running in the tomcat fast start, but after some time that very slowly. Check the log output, abnormal as follows: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: java.uti

  • Class loader - the memory leak problem of 2 2010-07-29

    Serious warning: If there is any application other than from a reference cited by the J2EE application itself class loader loads the class and class instance object, then ClassLoader class loader memory leak problem arises. ClassLoader class loader m

  • Java program in the "memory leak" problem 2010-07-20

    Transfer from: http://blog.csdn.net/gaofei_upc/archive/2009/12/17/5026951.aspx Soar Abstract: Java's memory management system from the beginning with a discussion of the Java process memory leak cause of the problem, citing a typical memory leak prob

  • Class loader - the memory leak problem of a 2010-07-29

    About websphere console to restart the application, rather than restart the websphere, this time a static class can not be recovered, resulting in some classes can not be destroyed, occupied by the memory, but this memory can not be reused, can be sa

  • Expert interviews "Tomcat 7 memory leak protection" 2011-04-28

    Earlier this year, DZone site to Mark Thomas for the Tomcat 7 memory leak protection functions of the interview, Mark Thomas is the chief software engineer at SpringSource is also the Tomcat code delivery charge. In the Tomcat 7 introduced a new feat

  • Java memory leak problem analysis 2010-03-29

    <! - Info --><!-- div> </ div> <div> <ul> <img src = "http://img1.e800.com.cn/service/temp/t12.jpg "/> <p> <a href=""> information first time </ a> </ p> </ ul> <ul&g

  • 2010.03.10 (3) - TomCat's a small problem 2010-02-01

    2010.03.10 (3) - TomCat's a small problem If you have a project to change the name after deployment, and even if you are once again deployed tomcat still using the original project name For example, I built an engineering student, I deployed to tomca

  • Java memory leak problem analysis (change) 2010-03-28

    People talking about memory leaks, of course, for c / c + +, this should be the long-standing problems, but many more Java staff also need to discuss this issue, I write a summary here, we want to have some reference value. Generous concept of memory

  • oracle rac jdbc connection with the last one will be connection closed problem 2010-08-11

    Connection code is as follows: Class.forName ("oracle.jdbc.driver.OracleDriver"). NewInstance (); String addrRAC = "(ADDRESS = (PROTOCOL = TCP) (HOST = host1) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = host2) (PORT = 1521))"; S

  • Browser memory leak problem tracking and resolution 2010-09-20

    Browser memory leak problem tracking and resolution prevailed before stored in Ajax, browser memory leaks is not a big problem, because they were all jump through the page and Shuaxin Laijinxingyu Jiaohu server side and they are now not the same, man

  • tomcat connection pool leak monitoring and resolving (change) 2010-05-09

    1. Problem Description Web programs running in the tomcat start fast, but over time found that very slowly. Check the log output, abnormal as follows: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: java.ut

  • Tracking C3p0 connection pool leak and log analysis of parameter optimization 2011-09-13

    <property name="unreturnedConnectionTimeout"> <value> 100 </ value> </ property> <property name="debugUnreturnedConnectionStackTraces"> <value> true </ value> </ property> Tracking C3p0 c

  • tomcat5.0.28, oracle connection pool configuration problem a solution 2010-06-25

    First configure tomcat connection pool, we met Cannot create JDBC driver of class''for connect URL 'null' issue after another for nearly a day and eventually after repeated attempts, can be found in normal operation according to the following steps:

  • tomcat memory leak problem (quoted from "arbitrarily paste") 2010-03-29

    1, linux, under simple, in the bin found catalina.sh, vi look, followed by annotations added after the sentence: JAVA_OPTS = '-Xms256m-Xmx256m' 256 is an example, you can write the physical memory of 1024 or even 2048, but the individual proposals 10

  • Javascript memory leak problem 2009-07-03

    Memory leak, that is, memory can not be configured correctly, the memory can not be timely and effective recovery, he will lead the implementation of efficient procedures for the implementation of the failure of even lower. The field in the browser,

  • axis and tomcat version of the problem 2010-03-29

    Originally written by webservice in their own computer can run, to run the company has not, So now, with a total reported null pointer exception Exception in thread "main" AxisFault faultCode: (http://schemas.xmlsoap.org/soap/envelope/) Server.u

  • flex memory leak problem 2010-07-12

    Flex memory leaks Transfer from: http://blog.csdn.net/lena_20081215/archive/2009/01/08/3735708.aspx Article 2 FLEX memory optimization techniques collection type: reproduced FLEX memory optimization principles released 1. Is deleted all references to

  • phpwind mysql connection closed a problem - character set encoding 2010-07-14

    Tossing a Lao Bantian, has been found phpwind connection closed mysql, but can use the mysql client on the remote connection, host, user name password are correct, by their own written script is a php mysql can be connected, the connection the same s

  • tomcat url parameter encoding problem 2010-09-16

    You will usually pass URL parameters to the server in the Chinese server receives a garbled usually the simplest solution is through conversion to utf-8 + escape form% E4% B8% AD% E6% 96% 87 google is using this method such the simplest and most rapi

  • Address address bar tomcat Chinese garbled transmission problem (Reprinted) 2011-01-12

    do tomcat web server, passed through the address bar, the Chinese argument, in order to prevent garbled on your browser to be configured in the server server.xml to configure the corresponding port can be encoded. For example: <Connector port = "8