Showing posts with label leak. Show all posts
Showing posts with label leak. Show all posts

Thursday, March 22, 2012

Connection pool leak in production machine (in other machine it runs well)

Hi to everyone,

I'm facing a problem that drives me crazy. I've a web application that has the following problem. When I test the application on my developement machine all runs fine, but when I put into production server there is a problem in connection pooling. Look at the following image, the blue line is the number of connection in the pool and the violet line is the number of connection reclaimed. From the image it is clear that connection are returned on the pool only in block, maybe when the garbage collection pass and reclaim the object. The strange thing is that on my developement machine all is good, and also I'm using Enterprise Library and the connection are managed internally.-

Thanks to everyone for any help.


How do you access DB? If you use some IDataReader, though they will be GC sooner or later, still remember to close them as soon as they are not used~|||

My big mistake is to misunderstood the meaning of the numberOfReclaimedConnection counter, that indicates the number of connections that are reclaimed by a garbage collector and indicate a leak. For some reason in my developement machine garbage collector does a more aggressive job in reclaiming connection while in the production server, maybe due to the large amount of ram garbage collection happens less frequently.

You're right about the datareder, one of the function in Data Access Layer forget to close a datareader in some situation, and it's called from a webModule that runs at every request for the page. The result is awful, when a lot of user access to the site the pool often become empty. I enclose the datareader in using block and all goes well again. From now on I will use perfmon.exe at every run of the site.

Alk.

Monday, March 19, 2012

Connection Leak

Hi,
I have troubles with a threaded application on W2003 server. It
seems to leave open connections behind time to time, it sums to hundreds over
a day (the application make thousands). It is using the SQLOLEDB provider,
MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
I put two Trace (print) statements : (1) Connection is opened. 2)
Connection is Closed.) I can see the two statements without any Exception.
But the problem is when I see on the Performance viewer (perfmon.exe/ perfmon.
msc->Sqlserver:General Statistics, User Connections) it shows Number of users
connected to the system is like thousands and more day by day ,Means the
number of open connections are in Hundreds…thousands and more . I am also
loosing the connections immediately with out any exception.
But still I am seeing open connection.
Please can anybody sort out my problem,
Is there a known bug like this? Is there a way to trace the SQLOLEDB provider?
Regards,
Rasheeds
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server/200612/1
"malkeshsheth via droptable.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundreds…thousands and more . I am also
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
Sounds like OleDb Session Pooling.
|||"malkeshsheth via droptable.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundreds…thousands and more . I am also
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
OOPS.
Sounds like you're using Connection Pooling (or whatever they call it in
OleDb)
See, eg
Support WebCast: ODBC Connection Pooling and OLEDB Session Pooling in
Microsoft Data Access Components
http://support.microsoft.com/kb/324686
David

Connection Leak

Hi,
I have troubles with a threaded application on W2003 server. It
seems to leave open connections behind time to time, it sums to hundreds ove
r
a day (the application make thousands). It is using the SQLOLEDB provider,
MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
I put two Trace (print) statements : (1) Connection is opened. 2)
Connection is Closed.) I can see the two statements without any Exception.
But the problem is when I see on the Performance viewer (perfmon.exe/ perfmo
n.
msc->Sqlserver:General Statistics, User Connections) it shows Number of user
s
connected to the system is like thousands and more day by day ,Means the
number of open connections are in Hundreds…thousands and more . I am also
loosing the connections immediately with out any exception.
But still I am seeing open connection.
Please can anybody sort out my problem,
Is there a known bug like this? Is there a way to trace the SQLOLEDB provide
r?
Regards,
Rasheeds
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200612/1"malkeshsheth via droptable.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundreds…thousands and more . I am als
o
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
Sounds like OleDb Session Pooling.|||"malkeshsheth via droptable.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundreds…thousands and more . I am als
o
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
OOPS.
Sounds like you're using Connection Pooling (or whatever they call it in
OleDb)
See, eg
Support WebCast: ODBC Connection Pooling and OLEDB Session Pooling in
Microsoft Data Access Components
http://support.microsoft.com/kb/324686
David

connection leak

Hi, in my web application i had a connection leak now that i solve this problem, i want to check if all connections are really closed.

I make a connection to an sql database.

I try on the database the sp_who procedue but i think, this is not that i can see if i colse all, connections

is there a other way to check or see if all connections are closed.

Enclosing the connection objects inside the "Using" block will make sure that the connection object is disposed off properly preventing any connection leaks. For e.g:

using(SqlConnection cn = new SqlConnection())

{

//DAL code

}


Check this out for details:

codebetter.com/blogs/john.papa/archive/2005/04/01/60984.aspx

Hope this helps,

Vivek

Connection Leak

Hi,
I have troubles with a threaded application on W2003 server. It
seems to leave open connections behind time to time, it sums to hundreds over
a day (the application make thousands). It is using the SQLOLEDB provider,
MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
I put two Trace (print) statements : (1) Connection is opened. 2)
Connection is Closed.) I can see the two statements without any Exception.
But the problem is when I see on the Performance viewer (perfmon.exe/ perfmon.
msc->Sqlserver:General Statistics, User Connections) it shows Number of users
connected to the system is like thousands and more day by day ,Means the
number of open connections are in Hundredsâ?¦thousands and more . I am also
loosing the connections immediately with out any exception.
But still I am seeing open connection.
Please can anybody sort out my problem,
Is there a known bug like this? Is there a way to trace the SQLOLEDB provider?
Regards,
Rasheeds
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200612/1"malkeshsheth via SQLMonster.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundredsâ?¦thousands and more . I am also
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
Sounds like OleDb Session Pooling.|||"malkeshsheth via SQLMonster.com" <u13567@.uwe> wrote in message
news:6b18cb6b1bfe5@.uwe...
> Hi,
> I have troubles with a threaded application on W2003 server. It
> seems to leave open connections behind time to time, it sums to hundreds
> over
> a day (the application make thousands). It is using the SQLOLEDB provider,
> MDAC 2.82.1830.0, SQL Server 8.00.2039 (SP4), Windows 5.2 (3790).
> I put two Trace (print) statements : (1) Connection is opened.
> 2)
> Connection is Closed.) I can see the two statements without any Exception.
> But the problem is when I see on the Performance viewer (perfmon.exe/
> perfmon.
> msc->Sqlserver:General Statistics, User Connections) it shows Number of
> users
> connected to the system is like thousands and more day by day ,Means the
> number of open connections are in Hundredsâ?¦thousands and more . I am also
> loosing the connections immediately with out any exception.
> But still I am seeing open connection.
> Please can anybody sort out my problem,
> Is there a known bug like this? Is there a way to trace the SQLOLEDB
> provider?
>
OOPS.
Sounds like you're using Connection Pooling (or whatever they call it in
OleDb)
See, eg
Support WebCast: ODBC Connection Pooling and OLEDB Session Pooling in
Microsoft Data Access Components
http://support.microsoft.com/kb/324686
David|||Yes David,
i hope you are correct !!!! So do you tell me. Is there any such issue or my
program has any fault?
if my program is wrong then same connection leak problem has to shown on my
machine, but it shown on client machine. So can you suggest me to resolve
such issues in which aria I have to concentrate?
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200612/1