I am using tesseract 4 on a VC++ (MFC) app, to read text from images (A4 sizes). I noticed that while I using this app on several PCs (Win10 64 bit, *GB RAM), the RAM occupied by my app (that use tesseract) is increasing on and on. If I read 14 images, my app eat 470 MB, and if I didn't close the app and read again all these 14 images, the RAM eaten by my app is increasing until ~800MB, and if continue to read the same images, the RAM is increasing on an on. Why is this happen ?--Here is the code that I am using for tesseract:BOOL CMyClass::GetTextFromImage(){PIX* pix = NULL;tesseract::TessBaseAPI* pTess = new tesseract::TessBaseAPI;do{if (pTess->Init(...)){m_sError.Format(_T("OCRTesseract: Could not initialize tesseract."));break;}// setup// read imagePIX* pix = pixRead(m_sFileName);if (! pix){break;}// recognizepTess->SetImage(pix);}while (FALSE);// cleanup// pTess->Clear();// pTess->End();delete pTess;pTess = NULL;pixDestroy(&pix);return TRUE;}Is there anything wrong here ? Why is increasing RAM while I am using tesseract ?
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/8be010ab-c948-47d3-b51e-ac141ce12bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
pTess->Clear();
pTess->End();
To unsubscribe from this group and stop receiving emails from it, send an email to tesser...@googlegroups.com.

pTess->End();
is called on destructor, am I right ?To unsubscribe from this group and stop receiving emails from it, send an email to tesser...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/125c6502-4afa-4fe6-ae04-f2ef14c0815b%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/e1a32685-d11a-4860-ac92-533dd795375c%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/e338cc87-e7c3-4bb0-bd94-632185e25652%40googlegroups.com.
I come in just in time: I have developed a little test application, which have debug and release, source code, and exe.Here is the code that get text from images:BOOL CTemp::GetTextFromImage(CString sFileName){PIX* pix = NULL;tesseract::TessBaseAPI Tess;do{if (Tess.Init(_T("C:\\tessdata-master\\"), _T("eng"), tesseract::OcrEngineMode::OEM_TESSERACT_LSTM_COMBINED))
{m_sError.Format(_T("OCRTesseract: Could not initialize tesseract."));break;}
// read imagePIX* pix = pixRead(sFileName);if (! pix){m_sError.Format(_T("Cannot open input file: %s."), sFileName);break;}// recognizeTess.SetImage(pix);}while (FALSE);// cleanuppixDestroy(&pix);Tess.Clear();Tess.End();return m_sError.IsEmpty();}Of course, you have put tessdata-master folder in C:The test app has an menu item: File->Read images, and from that CFileDialog you can select multiple image file, and you can see the state of reading in the statusbar.If you intend to run this project on you machine, you have modify yourself the paths in project settings. No big deal. The project is a VS2017 project, MFC.I run this app on few Win10 64bit machines, with the same results. I have loaded for my tests 14 images, and after all image has been converted, the test app took 466 MB, and after these 14 images has been loaded again, the app took 883 MB, after I loaded again, 1307 MB, and so on ... the only way to free RAM is to stop the app and start again ! Sad :(Here is the link for attachements: https://1drv.ms/f/s!AtSPCxnvttzegw6QHz8RAOjJq8fe
To unsubscribe from this group and stop receiving emails from it, send an email to tesser...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/e338cc87-e7c3-4bb0-bd94-632185e25652%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/00b7d682-befa-46d9-8c44-e349c5824d03%40googlegroups.com.