Clean unmanaged memory from .net

Posted on 2008-11-13
Last Modified: 2012-05-05
Hi Experts - Lets say I have .net code that makes a bunch of COM calls, and sometimes I fail to call Marshal.FinalReleaseComObject().  Over time I get a memory leak.  Is there a way to search (unmanaged?)  memory and release these COM objects?  Or do I have to release the object just as soon as I'm done with it?  I'm trying to cleanup after the fact. =)

Question by:sfun28
    LVL 8

    Expert Comment

    LVL 1

    Author Comment

    Hi rpkhare - these resources don't quite help.  Let me restate my question: I'm looking for a way to enumerate through all of the Runtime Callable Wrappers that my app has created.

    for example my code may get the following RCW, but never release the object
    dim abc as SomeCOMObject = ComObj.GetAnotherComObject

    I'd like a way, in some other thread or object, to enumerate the various live RCWs and free them.  is that possible?
    LVL 1

    Author Comment

    rpkhare or others?
    LVL 1

    Accepted Solution

    no answer so closing out

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now