On 26 June 2010 13:41, 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.
>

I've just looked at the tessnet2 webpage, and I see "Please ask
questions directly in the Tesseract forum". The author of tessnet2
should really have started his own mailing list, but as he hasn't you
should probably look at that page
(http://www.pixel-technology.com/freeware/tessnet2/), find his email
address and email him directly.

> 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?
>

I don't know .Net, and I'm not particularly interested in it, but the
memory leaks in tesseract were quite small... Taking a look at the
tessnet2 code, I see:

        char* TesseractToText(PAGE_RES* page_res)
        {
                return TessBaseAPI::TesseractToText(page_res);
        }

which is more than likely a memory leak (this memory has been
allocated using new[], while the .Net stuff is probably trying to run
free() on it, which will miss most of the memory that had been
allocated).

> Any suggestions would be much appreciated. Does Tesseract3 solve these
> memory issues, and is there a .NET wrapper yet or in the works?
>

Tesseract3 should fix them - at least, the memory leaks in tesseract,
not in tessnet2; I don't know of any plans for a .Net wrapper.

> 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.
>
>



-- 
<Leftmost> jimregan, that's because deep inside you, you are evil.
<Leftmost> Also not-so-deep inside you.

-- 
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