Not enough storage is available to complete this operation: E_OUTOFMEMORY

Error message “not enough memory/storage...” may appear in following cases :

• Processing multi-page documents

100-page document is considered as a quite large document. 100 ImageDocument and Layout objects may use up to 2 Gb or more in virtual memory (and 300-400 Mb are required  for FineReader Engine itself)

We recommend the following settings for minimizing memory usage:

IFRDocument::PageFlushingPolicy = PFP_FlushTo Disk 
IPrepareImageMode::ImageCompression = IC_Compress
IPrepareImageMode::KeepOriginalCoordinatesInfo = false (starting from FRE11 R5)

By default, temporary objects are stored in "%TEMP%/FREngine 12" folder. Use frDocument.TempDir property to change the temporary folder before calling frDocument.AddImageFile() method. The folder must already exist in the filesystem.

If you use PageFlushingPolicy = PFP_FlushToDisk, then make sure that you have enough free space on disk. For the 100-page document, we recommend 5-10 Gb free on the disk, where temp folder is located.

• Accessing sub-objects

In programming environments with automating garbage collection, using language constructions such as object0.subobject1.subobject2. … .subobjectN may lead to memory leak. The recommended approach is splitting such chains:

SubObject1Type object1 = object0.subobject1
SubObject2Type object2 = object1.subobject2 ...

In the end, when you don’t need these objects, they should be set to null.

• Deinitializing Engine periodically

Sometimes deinitializing Engine after processing batch of documents complete prevents memory issues. For example, you may call deinitialize Engine and initialize it again every 1000 images.

For .NET, our developers recommend calling GC.Collect, GC.WaitForPendingFinalizers before the DeinitializeEngine() method call and after processing each FRDocument. You may also call Marchal.ReleaseComObject for all objects.

Was this article helpful?

4 out of 38 found this helpful

Have more questions? Submit a request



  • Avatar

    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.

  • Avatar

    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?


Please sign in to leave a comment.