//  home   //  advanced search   //  news   //  categories   //  sql build chart   //  downloads   //  statistics
 ASP FAQ 
Home
ASP FAQ Tutorials

   8000XXXX Errors
   ASP.NET 2.0
   Classic ASP 1.0
      COM / ActiveX Components
      Forms
      General Topics
      Date/Time Routines
      Email Scripts & Info
      Files/Directories & FSO
   Databases
   General Concepts
   Search Engine Optimization (SEO)

Contact Us
Site Map

Search

Web
aspfaq.com
tutorials.aspfaq.com
classicasp.aspfaq.com

ASP FAQ Tutorials :: Classic ASP 1.0 :: COM / ActiveX Components :: When does ASP release COM objects?


When does ASP release COM objects?

Page-level 
 
If you have page-level objects and are running IIS 4.0, they are not released at the point in the page where you issue the following command: 
 
<% 
    set object = nothing 
%>
 
Page-level objects are NOT released until the page goes out of scope. And, according to many reports, the memory is not released completely if the object is *not* explicitly destroyed, as per above. 
 
IIS 5.0 and greater are reportedly much better at cleaning up the memory used by COM objects. Since it releases the object THE INSTANT you set it to nothing, there is suddenly a great advantage to doing so explicitly as early as possible in the code. In other words, create late, destroy early. 
 
Session-level 
 
Session-level objects, unless you explicitly release them from the session yourself, are (allegedly) destroyed when the session ends. This depends on how the session ends, of course. See Article #2078 for more information about how reliable Session_OnEnd() can be. 
 
There are very few scenarios where you should be using objects in session variables (see Article #2053). In about 99% of all cases, objects should be created and destroyed at the page level.

Related Articles

Can I code ISAPI filters / extensions with Visual Basic?
DLL: How do I avoid 'Permission Denied' when re-compiling?
How do I detect browsers without components?
How do I determine if a COM object is installed?
How do I determine if a VBScript-based object exists?
How do I generate PDF files from ASP?
How do I generate RTF documents from ASP?
How do I handle MD5 from ASP?
How do I pass server-side values to a client-side ActiveX control?
Should I close my objects and/or set them to nothing?
Should I store objects in session/application scope?
Should I use CreateObject or Server.CreateObject?
Where can I get a shopping cart for my web site?
Where can I get an updated version of browscap.ini?
Why do I get 'Server.CreateObject Access Error'?
Why do I get 8000401A errors?
Why do I get 80040111 errors?
Why do I get 80040112 / 8007045A errors?
Why do I get 800401F3 / 800A01AD errors?
Why do I get 80040460 errors?
Why do I get 80040514 errors?
Why do I get 8007000E errors?
Why do I get 8007007E / 8007007F errors?
Why do I get 80072EE2 errors?
Why do I get 80072EE5 errors?
Why do I get 800A0030 errors?
Why do I get 800A005B errors?
Why do I get 800A9C68 errors?
Why do I get 800C0007 errors?
Why does Browscap give me 'unknown' or tell me IE is Netscape?

 

 


Created: 8/13/2000 | Last Updated: 3/16/2005 | broken links | helpful | not helpful | statistics
© Copyright 2006, UBR, Inc. All Rights Reserved. (243)

 

Copyright 1999-2006, All rights reserved.
Finding content
Finding content.  An error has occured...