Server.CreateObject() vs new ActiveXObject()

Discussion in 'ASP General' started by Andrew Hilton, Feb 23, 2006.

  1. 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
     
    Andrew Hilton, Feb 23, 2006
    #1
    1. Advertising

  2. "Andrew Hilton" <> wrote in message
    news:%...
    > 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/windowsserver2003/iis/diagnostictools/default.mspx
     
    Egbert Nierop \(MVP for IIS\), Feb 23, 2006
    #2
    1. Advertising

  3. "Andrew Hilton" <> wrote in message
    news:%...
    > 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/windowsserver2003/community/centers/iis/
    http://mvp.support.microsoft.com/
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
     
    Tom Kaminski [MVP], Feb 23, 2006
    #3
  4. Egbert,

    "Egbert Nierop (MVP for IIS)" <> wrote in
    message news:%...
    >
    > "Andrew Hilton" <> wrote in message
    > news:%...
    >> 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/windowsserver2003/iis/diagnostictools/default.mspx

    Thank you, I will give this a try.

    Andrew
     
    Andrew Hilton, Mar 2, 2006
    #4
  5. "Andrew Hilton" <> wrote in message
    news:%...
    > Egbert,
    >
    > "Egbert Nierop (MVP for IIS)" <> wrote in
    > message news:%...
    >>
    >> "Andrew Hilton" <> wrote in message
    >> news:%...
    >>> 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/windowsserver2003/iis/diagnostictools/default.mspx

    > Thank you, I will give this a try.
    >
    > Andrew
    >
     
    Egbert Nierop \(MVP for IIS\), Mar 3, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raúl Martín
    Replies:
    1
    Views:
    10,838
    Natty Gur
    May 13, 2004
  2. =?Utf-8?B?RXVnZW5l?=

    javascript, new ActiveXObject() and events

    =?Utf-8?B?RXVnZW5l?=, Aug 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    13,343
    =?Utf-8?B?RXVnZW5l?=
    Aug 15, 2007
  3. ashish
    Replies:
    1
    Views:
    448
    ashish
    Aug 14, 2007
  4. Sagar

    Server.CreateObject Vs CreateObject

    Sagar, Jan 15, 2008, in forum: ASP General
    Replies:
    2
    Views:
    339
    Sagar
    Jan 15, 2008
  5. blini
    Replies:
    1
    Views:
    304
    Martin Honnen
    Apr 1, 2006
Loading...

Share This Page