Hi Paul,

You need to use AppDomain to unload
Copy the tessnet2 dll in a unique directory
Load it from the AppDomain
Use it
Unload the AppDomain
Delete de tessnet2 copy

See
http://social.msdn.microsoft.com/forums/en-US/clr/thread/dec948b4-0d00-4a34-a28e-2c0e0779b952

Remi

On Jun 26, 2:41 pm, Paul Russell <[email protected]> wrote:
> Hi,
>
> I have written a little aspx web app that uses the Tessnet2 .NET
> wrapper. It works perfectly, for about 3 goes, then I get "Out of
> Memory" errors.
>
> This is a small app running on a shared server so there is really no
> option of converting the code to an exe to ensure that after each scan
> that all associated DLLs etc are unloaded.
>
> This is a complete guess, but I assume that the wrapper when called is
> loaded into memory and the OCR is done. Now I know there is a memory
> leak(s) in Tesseract2, I would have thought that once the page has
> completed and served the response that all references would be
> unloaded from memory. It seems not to be, and I imagine that is
> possibly due to some sort of caching on the server so the DLLs don't
> need to be loaded again when someone requests it again?
>
> Is there anyway that I can completely unload this wrapper etc from
> memory when my page finishes? I have tried the Dispose method and the
> GC.Collect() and GC.WaitForPendingFinalizers(). I'm not sure what to
> do next?
>
> Any suggestions would be much appreciated. Does Tesseract3 solve these
> memory issues, and is there a .NET wrapper yet or in the works?
>
> Congrats on those maintaining this. It's a fantastic little library,
> such a pity about these leaks.
>
> Regards,
> Paul

-- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tesseract-ocr?hl=en.

Reply via email to