connection-leaks

Default HikariCP connection pool starting Spring Boot application

随声附和 提交于 2020-12-12 10:17:27
问题 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= jdbc:postgresql:// spring.datasource.username= spring.datasource.password= When checking the amount of connections in postgresql with: SELECT * FROM pg_stat_activity; I see each time I start the application exactly 10 connections are made. They almost all have the same query: SET application_name = 'PostgreSQL JDBC Driver' Is

Connections leaking with state CLOSE_WAIT with HttpClient

ⅰ亾dé卋堺 提交于 2020-05-10 20:56:42
问题 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 terminology: CLOSE-WAIT - represents waiting for a connection termination request from the local user. This is our client code which runs on WildFly 16 running on Java 12 as a stateless REST API. We don't understand why this is happening. import java.io

Connections leaking with state CLOSE_WAIT with HttpClient

淺唱寂寞╮ 提交于 2020-05-10 20:52:32
问题 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 terminology: CLOSE-WAIT - represents waiting for a connection termination request from the local user. This is our client code which runs on WildFly 16 running on Java 12 as a stateless REST API. We don't understand why this is happening. import java.io

Find Connection leak in Java application

断了今生、忘了曾经 提交于 2019-12-22 09:59:34
问题 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 leak. select LAST_CALL_ET, SQL_TEXT, username, machine, to_char(logon_time, 'ddMon hh24:mi') as login, SQL_HASH_VALUE, PREV_HASH_VALUE, status from v$session, v$sql where username='USERNAME' and HASH_VALUE = PREV_HASH_VALUE order by last_call_et desc; . I

My Spring application leaks database connections whereas I use the default Roo configuration

心已入冬 提交于 2019-12-12 09:20:05
问题 I am encountering an serious issue with my application. It leaks database connections whereas I use the default Spring Roo datasource configuration as follows: <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> <property name="driverClassName" value="${database.driverClassName}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.username}" /> <property name="password" value="${database.password}" />

ServiceConnection leak when not using BIND_AUTO_CREATE

不羁的心 提交于 2019-12-11 04:40:06
问题 Could you please explain to me, what happens when we bind to service, but never start it and then unbind? I'm getting "Activity has leaked a Service Connection error", but I do not understand why. MyService: package com.example.servicetest; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.IBinder; public class MyService extends Service{ Binder mLocalBinder = new Binder(); @Override public IBinder onBind(Intent intent) { return mLocalBinder

How to track database connection leaks

大兔子大兔子 提交于 2019-12-09 17:36:52
问题 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 great number of processes using my database. I want to find which files open connections but do not use it. I was thinking of using something like grep to, for each file, count the number of ".Open()" and the number of ".Close()", and get the file

My Spring application leaks database connections whereas I use the default Roo configuration

非 Y 不嫁゛ 提交于 2019-12-04 18:49:42
I am encountering an serious issue with my application. It leaks database connections whereas I use the default Spring Roo datasource configuration as follows: <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> <property name="driverClassName" value="${database.driverClassName}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.username}" /> <property name="password" value="${database.password}" /> <property name="testOnBorrow" value="true" /> <property name="testOnReturn" value="true" /> <property name=

Java, ResultSet.close(), PreparedStatement.close() — what for?

别来无恙 提交于 2019-12-04 11:54:10
问题 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 be overriden by the inheriting servlets to do their logic, and then closes the connection. I do not use connection pooling, because my application will have a very limited number of users and operations. My question is, what's the worst that can

How to track database connection leaks

主宰稳场 提交于 2019-12-04 04:55:52
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 great number of processes using my database. I want to find which files open connections but do not use it. I was thinking of using something like grep to, for each file, count the number of ".Open()" and the number of ".Close()", and get the file for which the numbers are not equal. Is it realistic? Bonus question: do the processes found in SQL