Questions tagged [connection-leaks]
73 questions
38
votes
3 answers
java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
Tomcat is running a webapp under Windows. After a few days (under very low load), the exception mentioned in the title starts to appear in the logs, no new connections can be established from that point on, the only fix is then to reboot the…

Michael Böckling
- 7,341
- 6
- 55
- 76
34
votes
6 answers
How to detect SqlServer connection leaks in a ASP.net applications?
I'm currently doing some GUI testing on a ASP.net 2.0 application.
The RDBMS is SQL Server 2005. The host is Win Server 2003 / IIS 6.0.
I do not have the source code of the application because it was programmed by an external company who's not…

Diego Tercero
- 1,143
- 1
- 11
- 17
13
votes
5 answers
Why doesn't this code close JDBC connections? (Java 7 Autocloseable unexpected behavior)
Using Java 7u5, with the try-with-resources construct, the following code appears to leak jdbc connections:
try (Connection connection = ..; PreparedStatement stmt = ..) {
stmt.setString(..);
return stmt.executeUpdate() > 0;
}
The next…

beefyhalo
- 1,691
- 2
- 21
- 33
11
votes
2 answers
Connections leaking with state CLOSE_WAIT with HttpClient
We are using JDK11 java.net.http HTTP client to get data from an API. After we receive the response the connections remain opened in our server with TCP state CLOSE_WAIT, which means the client must close the connection.
From RFC 793…

Evandro Pomatti
- 13,341
- 16
- 97
- 165
8
votes
2 answers
How to track database connection leaks
We have an app which seems to have connection leaks (SQL Server says that the max pool size has been reached). I am alone on my dev machine (obviously), and just by navigating the app, I trigger this error. The SQL Server Activity monitor shows a…

thomasb
- 5,816
- 10
- 57
- 92
8
votes
5 answers
Java, ResultSet.close(), PreparedStatement.close() -- what for?
In my web-application, i make extensive use of a database.
I have an abstract servlet, from which all the servlets that need a database connection, inherit. That abstract servlet creates a database connection, calls the abstract method which must…

Ibolit
- 9,218
- 7
- 52
- 96
8
votes
1 answer
Dump leak connections in WildFly
I am trying to dump leaked connections managed by a MySQL Data Source in WildFly 10.1, but I am not able to find the leak file or the leak dump.
Why is the leaks.txt file not being generated? And also, where should I look for the file?
Procedure
I…

Evandro Pomatti
- 13,341
- 16
- 97
- 165
7
votes
1 answer
Glassfish database connection leak caused by jms exception
I'm using Glassfish v2.1.1, MySQL 5.1 and ActiveMQ 5.4.2 incl. its resource adapter.
If the ActiveMQ resource adapter throws an exception when participating in a XATransaction including both a database and jms transaction
then glassfish will…

Trym
- 681
- 1
- 6
- 10
6
votes
1 answer
Connections leaking with state CLOSE_WAIT with java.net.HttpClient
We are using openJDK11.0.6 java.net.http HTTP (HTTP1.1) client to fetch content from websites. After a long execution time, we noticed a performance decrease. CPU is 100% used even when the app does nothing. We were able to determine that it comes…

Gregoire
- 142
- 8
5
votes
1 answer
Sockets of HttpURLConnection are leaked
I'm using OpenJDK 11 on Linux and I need to make sure all my web requests done with HttpURLConnection are properly closed and do not keep any file descriptors open.
Oracle's manual tells to use close on the InputStream and Android's manual tells to…

Emil
- 16,784
- 2
- 41
- 52
5
votes
5 answers
How to check the Database Connection leakage in Java EE application?
Is there any way to check the connection leakage in a Java EE application?
The application is running on my local machine. It uses a MySQL database and a user enters his details into this database.
In my opinion connection leakage means not closing…

Puru
- 8,913
- 26
- 70
- 91
5
votes
1 answer
What does persistent connection in Elasticsearch Python API mean?
I am using the Python Elasticsearch API to interact with ES in my application. Currently, as soon as the app gets a user request, it does esclient = Elasticsearch("127.0.0.1") and then uses this esclient to search for required data. But I recently…

yogk
- 271
- 5
- 15
4
votes
3 answers
Default HikariCP connection pool starting Spring Boot application
I'm using version: 2.1.6.RELEASE form Spring Boot in my pom.xml-dependencies.
To connect to my database I put following in application.properties:
spring.datasource.url=…

SimonartM
- 668
- 2
- 11
- 26
4
votes
0 answers
SQL Azure Request Limits and a possible connection leak
I have an interesting problem going on. I recently moved 2 SQL databases to SQL Azure for a client and all seemed to be going well...at first. Mid-morning I get a spike of error emails for various things, but a few common ones:
-The request limit…

rickers
- 59
- 5
4
votes
2 answers
Undertow on Spring leaks connections
I'm using Spring Boot (1.3.O.M5) with Undertow. Recently, I've found that when I use the
lsof -p $(pidof java)
command after a few hours, it presents me with about 700 lines, most of which are established TCP connections to clients, even though…

Jakub Kozłowski
- 493
- 1
- 6
- 13