Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Server.CreateObject() vs new ActiveXObject() (http://www.velocityreviews.com/forums/t800729-server-createobject-vs-new-activexobject.html)

Andrew Hilton 02-23-2006 08:13 AM

Server.CreateObject() vs new ActiveXObject()
 
When you create an object in classic asp code, should you always use
Server.CreateObject("ProgID")? Are there implications with stability (ie
memory leaks) if you create COM objects in other ways in IIS?

We use Javascript for our ASP coding, using a mixture of
Server.CreateObject() and new ActiveXObject(). The web server hangs
occasionally (once every 2-3 months) and we were wondering if this might be
the culprit...

Thanks!
Andrew



Egbert Nierop \(MVP for IIS\) 02-23-2006 08:31 AM

Re: Server.CreateObject() vs new ActiveXObject()
 

"Andrew Hilton" <hiltona@ocean.com.au.spamfree> wrote in message
news:%23HrDSEFOGHA.3460@TK2MSFTNGP15.phx.gbl...
> When you create an object in classic asp code, should you always use
> Server.CreateObject("ProgID")? Are there implications with stability (ie
> memory leaks) if you create COM objects in other ways in IIS?


Server.CreateObject is NT Option Pack 4 (NT4) legacy code and includes some
overhead.

> We use Javascript for our ASP coding, using a mixture of
> Server.CreateObject() and new ActiveXObject(). The web server hangs
> occasionally (once every 2-3 months) and we were wondering if this might
> be the culprit...


No definitely not. You could install debugdiag to know what was the real
cause.

http://www.microsoft.com/windowsserv...s/default.mspx


Tom Kaminski [MVP] 02-23-2006 02:49 PM

Re: Server.CreateObject() vs new ActiveXObject()
 
"Andrew Hilton" <hiltona@ocean.com.au.spamfree> wrote in message
news:%23HrDSEFOGHA.3460@TK2MSFTNGP15.phx.gbl...
> When you create an object in classic asp code, should you always use
> Server.CreateObject("ProgID")? Are there implications with stability (ie
> memory leaks) if you create COM objects in other ways in IIS?
>
> We use Javascript for our ASP coding, using a mixture of
> Server.CreateObject() and new ActiveXObject(). The web server hangs
> occasionally (once every 2-3 months) and we were wondering if this might
> be the culprit...


http://www.aspfaq.com/show.asp?id=2336

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS



Andrew Hilton 03-02-2006 02:39 AM

Re: Server.CreateObject() vs new ActiveXObject()
 
Egbert,

"Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
message news:%23OMaEOFOGHA.3988@TK2MSFTNGP09.phx.gbl...
>
> "Andrew Hilton" <hiltona@ocean.com.au.spamfree> wrote in message
> news:%23HrDSEFOGHA.3460@TK2MSFTNGP15.phx.gbl...
>> When you create an object in classic asp code, should you always use
>> Server.CreateObject("ProgID")? Are there implications with stability (ie
>> memory leaks) if you create COM objects in other ways in IIS?

>
> Server.CreateObject is NT Option Pack 4 (NT4) legacy code and includes
> some overhead.
>


Is it really legacy code? I can't find anything on MSDN to support that.
However I now know it's primarily used to launch COM+ objects, which makes
me wonder if the object is loaded into another process. In any case, it's
good enough argument to start using 'new ActiveXObject()'.

>> We use Javascript for our ASP coding, using a mixture of
>> Server.CreateObject() and new ActiveXObject(). The web server hangs
>> occasionally (once every 2-3 months) and we were wondering if this might
>> be the culprit...

>
> No definitely not. You could install debugdiag to know what was the real
> cause.
>
> http://www.microsoft.com/windowsserv...s/default.mspx

Thank you, I will give this a try.

Andrew



Egbert Nierop \(MVP for IIS\) 03-03-2006 02:00 PM

Re: Server.CreateObject() vs new ActiveXObject()
 

"Andrew Hilton" <hiltona@ocean.com.au.spamfree> wrote in message
news:%23OnAWKaPGHA.3272@tk2msftngp13.phx.gbl...
> Egbert,
>
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
> message news:%23OMaEOFOGHA.3988@TK2MSFTNGP09.phx.gbl...
>>
>> "Andrew Hilton" <hiltona@ocean.com.au.spamfree> wrote in message
>> news:%23HrDSEFOGHA.3460@TK2MSFTNGP15.phx.gbl...
>>> When you create an object in classic asp code, should you always use
>>> Server.CreateObject("ProgID")? Are there implications with stability
>>> (ie memory leaks) if you create COM objects in other ways in IIS?

>>
>> Server.CreateObject is NT Option Pack 4 (NT4) legacy code and includes
>> some overhead.
>>

>
> Is it really legacy code? I can't find anything on MSDN to support that.
> However I now know it's primarily used to launch COM+ objects, which makes


Yes, it is really legacy code. I don't want to proof this point by digging
into old MSDNs, just try this on NT4 with the option pack.

> me wonder if the object is loaded into another process. In any case, it's
> good enough argument to start using 'new ActiveXObject()'.


sure it is good enough. for instance, ADODB does nothing, really nothing
with ASP while IIS tries to find some legacy method 'OnStartPage' through
late binding if you use Server.CreateObject and it also did some things with
transactions in the past I believe.

>>> We use Javascript for our ASP coding, using a mixture of
>>> Server.CreateObject() and new ActiveXObject(). The web server hangs
>>> occasionally (once every 2-3 months) and we were wondering if this might
>>> be the culprit...

>>
>> No definitely not. You could install debugdiag to know what was the real
>> cause.
>>
>> http://www.microsoft.com/windowsserv...s/default.mspx

> Thank you, I will give this a try.
>
> Andrew
>




All times are GMT. The time now is 10:46 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.