Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

memory leaks in IIS7 using ado

59 views
Skip to first unread message

FrankW

unread,
Dec 3, 2010, 12:06:04 PM12/3/10
to
I work on a very large web application written in asp that leaks
memory in IIS7 but not IIS6. I have narrowed the leaks down to 2
different operations on ADODB.Connection. To reproduce create an asp
page based on the following code changing the connection string and
run on Windows Server 2008, 2008 R2, windows 7, etc. Watch the memory
for w3wp.exe in task manager continually rise as you repeatedly
refresh the page. The same code in IIS6 does not leak.

I would like to see Microsoft confirm or explain how to avoid these
issues. I can easily work around using the ConnectionString property
but the leak on IsEmpty(cn) would be harder to work around due to the
use of it in lots of places.

<%

Sub CloseFunction( cn )
If Not IsEmpty(cn) Then ' leak #1 comes from calling IsEmpty on a
connection object
cn.Close
End If
End Sub

Sub ConnectionTest
On Error Resume Next
for i = 1 to 20000
Set theConnection = Server.CreateObject("ADODB.Connection")
theConnection.CommandTimeout = 120
theConnection.Provider = "sqloledb"
ProvStr =
"Server=YourServer;Trusted_Connection=no;UID=YourPassword;PWD=police&0!;Database=YourDatabase"
theConnection.Open ProvStr
test = theConnection.ConnectionString 'leak #2 comes from accessing
ConnectionString
CloseFunction theConnection
set theConnection = Nothing
next

Response.Write i
Response.Write err.Description
End Sub


ConnectionTest

%>

Bob Barrows

unread,
Dec 6, 2010, 12:17:03 PM12/6/10
to
FrankW wrote:
> I work on a very large web application written in asp that leaks
> memory in IIS7 but not IIS6. I have narrowed the leaks down to 2
> different operations on ADODB.Connection. To reproduce create an asp
> page based on the following code changing the connection string and
> run on Windows Server 2008, 2008 R2, windows 7, etc. Watch the memory
> for w3wp.exe in task manager continually rise as you repeatedly
> refresh the page. The same code in IIS6 does not leak.
>
> I would like to see Microsoft confirm or explain how to avoid these
> issues.
You will not get a response from Microsoft here, despite the name of
this newsgroup. MS discontinued its support of newsgroups several months
ago. Try
http://social.msdn.microsoft.com/Forums/en-US/category/dataplatformdev
There are other forums at
http://www.microsoft.com/communities/forums/default.mspx

I cannot reproduce your issues since I am still using IIS6

FWIW, I never used IsEmpty to test whether a variable referred to a
Connection object. I typically use "Is Nothing" to test whether or not a
variable refers to an object or not.

--
HTH,
Bob Barrows


0 new messages