Each time I execute OcrEngine.Run on a document, a new lfomniocr19.exe process spawns that remains persistent for some time on the Laserfiche server. I created a small function to test this out:
public bool ocrDoc(int entryId) { DocumentInfo doc = Document.GetDocumentInfo(entryId, _lfSession); using (OcrEngine ocrEngine = OcrEngine.LoadEngine()) { ocrEngine.Run(doc); } return true; }
Each time it runs, a little memory is chewed up dealing with the OCR. But even when the function is done, the memory is still used and the process persists. The app I'm having issues with runs multiple documents through OCR via a search result listing which keeps it from spawning thousands of processes. However, the issue is still the same. While the listing only generates one lfomniocr19.exe for thousands of documents, it uses far more memory and the memory remains stuck for hours or even days. Once another round of OCR commences, that memory gets used up and eventually the system runs out of resources.
Is there a way to immediately get back that memory? Am I missing a call that shuts down lfomniorc19.exe and returns all of it's resources?