Frequently asked question

Should I store ActiveX Connector objects in the ASP session object?

Last Published: April 25, 2020

Answer

ESRI discourages the practice of storing ActiveX Connector objects in an ASP Session and Application objects because of the following two reasons:

The ActiveX Connector uses the single threaded apartment model

After being instantiated, single-apartment threaded objects must remain associated with a single worker thread. Usually ASP handles requests from a pool of threads using the first available thread. When storing ActiveX Connector objects in ASP variables the same thread that handled the previous request must be used. This means that the request will be delayed until that single thread is free even if there are many other threads free that could have completed the requested operation.

This will cause a significant performance hit.

The ActiveX Connector consumes excess memory

Developers storing the ActiveX Connector generally only need a very small subset of the information that the ActiveX Connector stores. The ActiveX Connector when stored in the session object takes megabytes when most users only want to store a few bytes of information, such as extent and layer list information. Lightly used or moderately used ASP sites that cache the ActiveX Connector Map object can see memory for only the Map objects that consume over a hundred megabytes of RAM.

Session usually exist for 20 minutes after the user has stopped using the site. ASP websites storing the ActiveX Connector in session variables consume more RAM than they need to while that site is accessed by many people for short periods of time.

Article ID:000006475

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic