Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 11th, 2004, 07:41 PM
Registered User
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Think I have a memory leak, need advice


The code I have listed below seems to be causing Inetinfo.exe to jump up to 100%. The OS is NT4 with the NT4 option pack. Old school I know.

<% If Request.QueryString("status")="approve" Then

'updating por table sets Admin to null and new margin numbers assigned
set rs_o = server.CreateObject("ADODB.recordset")
sql="select * from por where spec='"&Request.QueryString("spec")& "' and por_id='" & trim(Request.QueryString("por_id"))& "'"    
rs_o.Open sql,ConnectTo,3,3

'assign approved status 
set rs_c = server.createobject("ADODB.Recordset")
sql1="select * from por_change where por_id='"&Request.QueryString("por_id")&"' and id='"&Request.QueryString("id")&"'"     
rs_c.Open sql1,ConnectTo,3,3 
'set rs_c = nothing


    'sql1="select top 1* from por_change order by id desc"     
    'rs_c.Open sql1,ConnectTo,3,3
    'set rs_c=nothing 

    Set objMail = Server.CreateObject("CDONTS.NewMail")
    'Recipients deleted to protect the names of the innocent

    link="<br><b>A change order has been submitted for Spec "&rs_o("spec")&"  and is ready for administrative review. </b><br>Please click on the link below to complete this portion of processing<br><a  href='http://lmyr2d2a/fssr/por.asp?spec="&rs_o("spec")&"&por_id="&rs_o("por_id")&"'>POR FOR SPEC "&rs_o("spec")&"</a><br><br>"
    objMail.Subject="POR Change Order"


    Set objMail = nothing
    set rs_o = nothing
    set rs_c = nothing
Sorry for the lousy formatting and all the comments. I'm still debugging this so I need to be able to grab variables every now and then. Any help would be appreciated.

Thanks in advance.
Old March 12th, 2004, 03:45 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Can't see a reason why this would cause this behavior.

You might want to avoid using your magic number s (e.g. rs_o.Open sql,ConnectTo,3,3) to make the code more readable. Check out this: http://www.adopenstatic.com/faq/800a0bb9step2.asp for more info.

rs_o.Open sql,ConnectTo,adOpenStatic,adLockPessimistic ( or whatever the number mean)

is much easier to understand than

rs_o.Open sql,ConnectTo,3,3

To find out what is causing the problem, create a copy of the page, remove anything you don't need and then one by one add your code block back in.

Right now, the code is, as you said yourself, lousy formatted which makes it hard to read.



Imar Spaanjaars
Everyone is unique, except for me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak in a loop neilsands Java Basics 4 March 17th, 2010 05:59 AM
Looking for Memory Leak Advice Bill_Thompson Visual C++ 0 October 16th, 2007 05:42 PM
IE Memory Leak Jman82 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 July 6th, 2006 05:22 PM
Memory Leak in ADO Seeja Pro VB Databases 1 December 27th, 2004 07:28 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.