We are using document understanding in production and on a daily basis client wants to send around 500-600 documents. But if those many numbers of documents are sent, we usually get below error. Please let me know if there is any solution for it.
Error on Digitizing Document - Request CorrelationId: 93a47ead-e0f4-4746-a1d9-35fe8ec3553b Request PredictionId: 7nF6KNS4jjpap0ZhC10yycGhAAG5MEFvTYcpXusaflw=_bd4fe4d9-90b7-4acb-8ce4-5d17adfb7580 Error performing OCR: Exception of type ‘System.OutOfMemoryException’ was thrown.
NOTE : This error does not occur when they process around 300 documents, only when volume is more it occurs.
@B_H_Akshatha_Pai This looks like a memory issue during the OCR/Digitization step. Since it works fine for around 300 documents and starts failing only when the count goes higher, the process is probably consuming too much memory when many documents are sent together.
I would suggest not sending all 500–600 documents in one batch. Instead, try processing them in smaller batches, like 100 or 150 documents at a time.
A better approach would be to use Orchestrator Queues, where each document is added as a separate queue item and processed one by one. This will also make retry handling easier if any document fails.
Also, please check if multiple jobs/bots are doing OCR at the same time. If yes, try reducing the parallel execution, because OCR usually consumes more memory, especially for large scanned PDFs.
You can also check the document size and page count. Large or poor-quality scanned files can use more memory during OCR.
Since the error has a CorrelationId and PredictionId, I would also recommend raising a ticket with UiPath Support. They can check the backend logs and confirm if the issue is due to service-side limitations.
In short, try processing the documents in smaller batches or queue-based processing instead of sending all documents together. That should make it more stable.
As you mention issue is not occurring for ~300 documents, it indicates resource exhaustion after long continuous processing rather than document issue.
Split documents into smaller batches (100–150 documents)
After each batch:
add small delay OR
restart OCR/robot process
Reduce PDF/image resolution if files are heavy
Increase machine RAM if possible
Because the error is:
System.OutOfMemoryException
which means OCR engine memory is getting exhausted after processing high volume continuously.
The issue in UiPath Document Understanding is due to memory overload during bulk OCR processing. When 500–600 documents are processed in one go, each document consumes memory during digitization, leading to System.OutOfMemoryException.
The best approach is to avoid bulk processing and instead use a queue-based REFramework design where each document is processed as a single transaction, or split the workload into smaller batches (50–100 documents). This ensures memory is released properly between transactions and keeps the process stable in production.
You are facing issues due to memory leaks. In order to avoid memory leaks and out of memory exception. Below are some of the best practices to be followed:
If you are using Invoke workflow, try to keep “isolated” property checked.
Do not pass data tables as arguments. Instead of that, write out the information to a temporary excel sheet, and read it again from the XAML where you intend to use it for further processing.
Clear data tables, when they are not in use anymore, if you have used any.
Dispose (clear)of variables when not in use.
This usually happens because the OCR service runs out of memory when too many documents are processed together. Since the issue starts only after 500–600 documents, it’s more of a load or resource problem than a document issue. Try processing the files in smaller batches, reduce parallel processing, and check the server/VM RAM usage. Also make sure the Document Understanding and OCR packages are updated, as newer versions often fix memory-related issues.