first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

ASP: Performance Hits When Using the Application Object?

Yes. I have heard many many times about not using the Session object for performance and load-balancing reasons, but no one seems to talk about these things when it comes to the Application object.

In fact, Microsoft demos its VB6 WebClass by plugging it directly into the Application.Contents() collection as an Object variable! (BTW: when I try to do this with a VB ActiveX DLL it fails when loaded a second time but that is another story.) Isn't this a performance hit? This is not a rhetorical question. Tom Baastad answers (from tek-tips.com):

"The main reason for not using the Application object is that it forces IIS into single thread mode for the time consumed starting with locking the application object, manipulating the variable, etc until the object is unlocked."

"Another potential problem is the scope of an object in application mode, where it has been known to create both memory leaks and weird crashes of the IIS application."

"As a rule of thumb one should open an object on the same page that is being used and close it before that page is exited. This should help you steer clear of the dreaded ASP0115 error that is often associated with objects not being properly closed, etc."

mod date: 2002-01-05T16:57:32.000Z