This is a good solution when you work with a dynamically loaded
component (e.g. DLL) but not when you just link to the library ...

I am running Tesseract 3.0 built as a library linked to a Mac OS
application and this is the leak I am measuring for successive scans:
- image with lots of lines: around 400MB
- image with 3 or 4 lines: around 40MB
- almost blank image: around 20MB

I noticed that the leaking allocations are done during the processing
continuously (i.e. not right at the start or the end of processing an
image) so it seems it's the structures for holding lines and blocks.

I just call Init(), SetPageMode(), SetImage() and GetBoxText(). For
after each image processing I call End() on my TessBaseAPI class
instance and even call delete() on it, for good measure - but to no
avail. Would it help if I used lower level Tesseract API returning
blocks and page res structures and released them explicitly?

It's commonplace to have memory leaks but 400MB seems so high that I
am still hoping I am doing something wrong.

Thanks!
Patrick

On Sep 18, 9:48 am, "Svetlin Nakov" <svet...@nakov.com> wrote:
> It is well known that Tesseract has multiple memory leaks so I think you can
> periodically unload the managed wrapper .NET assembly and load again. To do
> so you could load it in a separate application domain and unload the entire
> domain and re-create it periodically (e.g. when the memory consumption
> reaches some threshold).
>
> See more about application domains, loading and unloading assemblies at
> runtuime here:http://msdn.microsoft.com/en-us/library/ms173101.aspx
>
> Regards,
>
> Svetlin Nakov
> Managing Partner
> Consulting and Information Technology Agencyhttp://www.citagency.eu
>
> -----Original Message-----
> From: tesseract-ocr@googlegroups.com [mailto:tesseract-...@googlegroups.com]
>
> On Behalf Of nicdnepr
> Sent: Friday, September 18, 2009 3:06 PM
> To: tesseract-ocr
> Subject: memory problem
>
> hi
> i use Tessnet2 a .NET 2.0 Open Source OCR assembly using Tesseract
> engine
> from articlehttp://www.pixel-technology.com/freeware/tessnet2/
> after 1000 persed images i have 500 MB memory used in program. how can
> i resolve this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To post to this group, send email to tesseract-ocr@googlegroups.com
To unsubscribe from this group, send email to 
tesseract-ocr+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/tesseract-ocr?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to