Symptoms
The following error may appear during the processing in FineReader Engine 12:
Not enough storage is available to complete this operation: E_OUTOFMEMORY
Cause
This issue often appears when system resources are not enough to process the document.
Resolution
-
When processing multipage documents:
100-page document is considered as a quite large document. 100 ImageDocument and Layout objects may use up to 2 GB or more of virtual memory, not mentioning the memory required for image processing.
It is recommended to use the following setting for decreasing memory consumption:IFRDocument::PageFlushingPolicy = PFP_FlushTo Disk
More information about it can be found in the help file.
Please note that temporary objects are stored to %TEMP% folder. It is possible to change the folder for temporary files by modifying IFRDocument::TempDir property (this folder should be created in advance) before calling IFRDocument::AddImageFile() method. The other side of PageFlushingPolicy = PFP_FlushToDisk is that there should be sufficient free space on the drive, where temporary files are stored. For a 100-page document, it is recommended to have at least 5-10 GB of free space.
-
Accessing sub-objects:
It is not recommended to make long chains of sub-objects:object0.subobject1.subobject2. … .subobjectN
as it may lead to memory leak.
The better approach is to split such chains:
SubObject1Type object1 = object0.subobject1
In the end, when these objects are not needed, they should be set to null value.
SubObject2Type object2 = object1.subobject2...
-
Deinitializing Engine periodically
Sometimes, deinitializing Engine from time to time may help to prevent memory issues. For example, it is possible to call deinitialize Engine and initialize it again every 1000 images.
It is recommended to call GC.Collect, GC.WaitForPendingFinalizers before the DeinitializeEngine method and after processing each FRDocument, and Marshal.ReleaseComObject for all objects.
Comments
3 comments
Ken Falk CCIM
100 page document - out of memory error. Your recommendation may be clear to a computer professional, but not to me. I have 251GB of free solid state disk memory and 64GB RAM, but get the out of memory error when recognizing a document. What simple settings, in plain simple language, should I go to, to reset the memory available available for processing a 100 page document in FineReader 15 Corporate?
Victoria Dvornikova
Hi Ken,
Please note, that this article describes a solution for FineReader Engine product. I have created a support ticket based on your comment, please await a reply from Support Team.
Nikolaos Giannakopoulos
Hi Victoria,
I have an error «Error communicating with ABBYY Product Licensing Service on IP: Not enough storage is available to complete this operation.» keeps occurring at the testing installation of FRE12 . I am using the default port of Licensing Server for FRE12. The app service uses service plan P2V2 (7GB memory, 250GB storage), Licensing Server has ~10GB free memory and ~15GB free storage.
I have also noticed that several connections with the Licensing Server remain open after the error has occurred. Is this normal?
Please advise me, how the specific error will be overcome.
Thanks in advance.
Please sign in to leave a comment.