none
Memory Leak from OCX

    Question

  • Hi All

    I have an OCX written in C++ which has been wrapped up into a VB dll. This OCX seems to have a memory leak which I cannot resolve as I do not have the original code or the related libraries.
    I am using this VB dll in my Winforms application. As the application runs, it loops through a Dataset of 20000 rows invoking the methods from the ocx/dll for every row. The memory usage goes up steadily even though after invoking the methods on the oxc/dll, I dispose of the intance of the ocx/dll.
    When I close the application, the memory is released back to the system.
    Is there anyway I can release the memory to the system after disposing the OCX/dll.???
    Please help as this is driving me nuts......

    Extract extDoc = new Extract();

    try

    {

    ret = extDoc.extractDoc(docid, format);

    }

    finally

    {

    if (extDoc != null)

    {

    extDoc.Dispose();

    }

    }

    GC.Collect();

    Wednesday, July 05, 2006 3:29 PM