Skip to content

Conversation

@andrinr
Copy link
Contributor

@andrinr andrinr commented Dec 19, 2025

Relevant issue or PR

Running on a system with X amount of memory. Per default, each Docker container has a memory maximum that is set to X. When running multiple Docker containers on the same system, OOM can occur as Docker does not manage memory in a global fashion.

Description of changes

  • Exposes --memory to the run and serve CLI commands.
  • Exposes memory as an argument to the Tesseract.from_image Python API function.

When not passing any value, the default behavior is still unlimited memory. That is each container can use as much memory as the system provides.

Testing done

Added several tests for the added functions.

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.75%. Comparing base (5284bb6) to head (c401fcb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #429      +/-   ##
==========================================
+ Coverage   66.91%   76.75%   +9.83%     
==========================================
  Files          29       29              
  Lines        3431     3433       +2     
  Branches      535      536       +1     
==========================================
+ Hits         2296     2635     +339     
+ Misses        945      568     -377     
- Partials      190      230      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrinr andrinr marked this pull request as ready for review December 19, 2025 10:02
@dionhaefner
Copy link
Contributor

I wonder if we should have a catch-all flag instead that allows passing arbitrary args to docker run. We likely can't anticipate all potential usage with several dozen flags to docker run?

@andrinr
Copy link
Contributor Author

andrinr commented Dec 19, 2025

@dionhaefner good point! I cannot think of any downsides, so Id say that is the better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants