keyongtech


  keyongtech > dotnet.framework.* > dotnet.framework.main > 02/2008

 #1  
02-04-08, 11:16 PM
DR
How to make MODI.Document not leak memory? I have millions of images to OCR
but each time i OCR one it leaks memory. How to do the OCR and then clean up
so that my app doesnt leak memory?

MODI.Document miDoc = new MODI.Document();
for (int i = 0; i < 1000; i++)
{
miDoc.Create("a.gif");
miDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
MODI.Image tifImg = (MODI.Image)miDoc.Images[0];
string recSTring = tifImg.Layout.Text;
miDoc.Images.Remove(tifImg);
miDoc.Close(false);
}
int i23z = 23 + 23;
miDoc.Close(false);
 #2  
02-04-08, 11:41 PM
Scott M.
I'm assuming that MODI.Document() is a COM object?

If so, you need to call Marshal.ReleaseComObject Method to tell the CLR that
it should release its hold on the underlying COM object.

http://msdn2.microsoft.com/en-us/lib...mo bject.aspx



"DR" <softwareengineer98037> wrote in message
news:4160
[..]
Similar Threads
How to make MODI.Document not leak memory? I have millions of images to OCR but each time i OCR one it leaks memory. How to do the OCR and then clean up so that my app doesnt leak memory?

How to make MODI.Document not leak memory? I have millions of images to OCR but each time i OCR one it leaks memory. How to do the OCR and then clean up so that my app doesnt...

To clean up memory leak : Log out or Reboot

Hi, I am developing software on Windows XP, before the code matures normally it has many memory leak problem. I notice that the PC run more and more slower. I normally do a...

Clean up of memory leak in unmanaged code

Hi all I have been wandering about the best way to sandbox memory leaks in 3rd party libraries when using them from the .Net framework. I have a 3rd party library, written...

Memory Leak Detector - leaks in CreateClassEnumerator?

Hi! I ran a check of Memory Leaks, and a few hundred bytes were "leaked" supposedly from the CreateClassEnumerator call. I copied this function from other SDK programs and I...

Flash OCX Memory Leak, Or .Net Framework Memory Leak

Hello All, I have a windows application that uses the Flash OCX v7. The swf's are about 30MB and of course, memory usage goes up when each form is loaded. However, when the...


All times are GMT. The time now is 08:22 AM. | Privacy Policy