Destroy COM object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jenny

    #1

    Destroy COM object

    Hi all,

    my ASP.NET page generates an COM object which is filled
    with a lot of data (approx. 30 MB).
    It is then stored in the Application-Collection to be
    accessible for all users of the page.

    Under some conditions I don't need this COM object anymore
    and like it to be destroyed.
    I'm using the following code to destroy this object:

    Application.Loc k()
    Application.Rem oveAll()
    Application.Cle ar()
    Application.UnL ock()
    GC.Collect()
    GC.WaitForPendi ngFinalizers()

    But the Private Memory Size increases instead of descreasing!!
    Why???


    Thanks in advance for all help!

    Jenny
  • Alvin Bruney

    #2
    Re: Destroy COM object

    Try setting the COM object to tell after all this. If this com object is
    wrapped in some class you will need to call/implement dispose on it.


    "Jenny" <j.malloyNO@SPA Mx-mail.net> wrote in message
    news:04ee01c34f 66$462cde70$a50 1280a@phx.gbl.. .[color=blue]
    > Hi all,
    >
    > my ASP.NET page generates an COM object which is filled
    > with a lot of data (approx. 30 MB).
    > It is then stored in the Application-Collection to be
    > accessible for all users of the page.
    >
    > Under some conditions I don't need this COM object anymore
    > and like it to be destroyed.
    > I'm using the following code to destroy this object:
    >
    > Application.Loc k()
    > Application.Rem oveAll()
    > Application.Cle ar()
    > Application.UnL ock()
    > GC.Collect()
    > GC.WaitForPendi ngFinalizers()
    >
    > But the Private Memory Size increases instead of descreasing!!
    > Why???
    >
    >
    > Thanks in advance for all help!
    >
    > Jenny[/color]


    Comment

    Working...