Questions tagged [connection-leaks]

72 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
  • 6,286
  • 6
  • 46
  • 59
33
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…
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,491
  • 2
  • 19
  • 33
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…
8
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
  • 7,960
  • 11
  • 56
  • 111
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
  • 8,071
  • 5
  • 46
  • 76
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
  • 7,960
  • 11
  • 56
  • 111
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…
5
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
  • 63
  • 5
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
  • 12,011
  • 2
  • 28
  • 39
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…
User 1034
  • 8,145
  • 25
  • 67
  • 88
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
  • 483
  • 1
  • 6
  • 12
3
votes
2 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
  • 377
  • 6
  • 19
3
votes
2 answers

Find Connection leak in Java application

I have an application which starts giving me internal server error after some time, Some people I asked told me that this can be because of Connection leak in my application. I started searching and found this query to simulate connection…
aatif
  • 145
  • 1
  • 1
  • 8
3
votes
1 answer

How to identify the owner of a monitor lock in Java

Our Java Application running with WildFly 8.2.1 and Java 1.8_92 hangs completely on huge load. A threaddump at this situation shows that a lot of threads are in state WAITING at monitor 0x00000005cc562228: "default task-100" #825 prio=5 os_prio=0…
1
2 3 4 5