Are objects, declared and instantiated on an asp page, implicitly destroyed when the server finishes building the page or do I have to explicitly set them to nothing to tell the garbage collector that there are no more references to that object?
They are automatically "cleaned" up. Basically you don't have to worry about it anymore. But best practices dictates that you try to free them up. Because this clean up is supposely not perfect. With regards to database connections though. ADO and IIS cooperate to keep some of these connections open for a few moments more until inactivity (no more accesses on any asp pages) times out the connection. This is because establishing a connection is a heavy weight operation and results in unpleasant pauses to the user access experience. You'll have to look up some ASP books to figure out how exactly IIS and ADO do this. Would someone please correct me if I am wrong?
In theory they are cleaned up.
Some hosts get upset if you don't clean up your objects after yourself. If you're developing stuff that others may host/use elsewhere it pays to be tidy with your objects if only to keep them out of trouble.
Fog Creek Home