You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat/Guard against excessive memory usage when partitioning PDFs #2129
Is your feature request related to a problem? Please describe.
Using the OCR strategy when partitioning PDFs, processing of some PDF files will allocate a large amount of memory that isn't available in all environments (e.g. when running via Google cloud run with limited resources).
Unstructured should employ sensitive defaults to avoid this kind of situations (e.g. a max size of a page when rendered in memory). This could also be configurable as optional argument on the partitioning method.
In cases where this isn't feasible, the partitioning method should raise a descriptive exception so the caller can handle the situation gracefully instead of crashing the process.
The most important aspect is giving a way to limit the amount of memory unstructured will use during partitioning.
Describe alternatives you've considered
Alternatively, the partitioning can be run in a separate memory-limited process which is controlled by another process. In case the partitioning process runs out of memory, the orchestration process can handle the situation.
Reacted by Aaron ("AJ") Steers, jamesschinnerplxs, Ryan Suryadinata, markymark, Arthus Bourcier, Carlovinggio, Philbo, Imad Saddik and Mike Gugel
@christinestraub - I know you've added some code (like batching pages for PDF to image conversion) to limit excessive memory usage. Was there anything else you had in mind to help with that? Think this would be a good topic to follow up on.
Activity
MthwRobinson commentedon May 20, 2024
@christinestraub - I know you've added some code (like batching pages for PDF to image conversion) to limit excessive memory usage. Was there anything else you had in mind to help with that? Think this would be a good topic to follow up on.
ImadSaddik commentedon Feb 26, 2025
Any update ?
ocg2347 commentedon Jul 11, 2025
Any update?
I have 250-page pdf. and when i try to run:
I get OOM and the process is killed on a 62GB-RAM machine, no exception messages whatsoever