|
ASP Commandment #7: No COM objects in
Sessions
Do not store any COM objects in a Session() variable
because of memory waste and threading issues. Do not store any COM objects in an Application()
variable unless the reasons are excellent because of concurrent access issues. For even
more details:
Memory Waste Scenarios
Let us examine a typical usage pattern:
+ 100 people hit your site for a couple of pages
and leave
+ 100 new people arrive in a couple of minutes
+ 200 people arrive after that and leave within a couple of minutes and then
+ 50 people arrive
Scenario 1:
object in session_onstart |
Scenario 2: objects
created/destroyed on a page per page basis |
End Result:
450 sessions/objects in memory
with 50 people on your site. And dozens or hundred of threads that can't be reclaimed for
a while |
End Result:
50 objects in memory
with 50 people on your site. No unused threads must be kept in memory. |
Connection pooling or MTX object caching may
actually result in more than 50 objects in memory in the Scenario 2 and more than
450 objects in Scenario 1 for better performance. Basically set object=nothing may be
ignored and the object placed in an "instant ready" pool to be used by the next
server.createobject request.
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|