[thelist] checking for unclosed objects in ASP

Means, Eric D eric.d.means at boeing.com
Wed Oct 2 09:14:01 CDT 2002

-----Original Message-----
From: miinx [mailto:lists at miinx.com.au]
Sent: Wednesday, October 02, 2002 8:53 AM
To: thelist
Subject: [thelist] checking for unclosed objects in ASP

> Is there any way to check for unclosed objects in ASP?

Not that I know of (without buying a commercial tool), but you can just add
a bunch of

Set x = Nothing
right before your Response.End (where x is the name of an object)

> When I'm debugging I often use Response.End, but I imagine this leaves
> everything open... I begin to notice performance degradation after a few
> page run throughs doing this.

Actually, the ASP engine should clean up any objects allocated on the page
when the response completes.  However, if you're creating any Session or
Application objects (or variables), those can quickly grow unwieldy.  IIRC
you can use For Each to dump the contents of Application and Session to see
if you're creating unnecessary vars.

(Oh, and objects -- esp. DB related objects -- should *never* go in Session
or Application level variables for concurrency and performance reasons.)

More information about the thelist mailing list