OCR & Container Tuning
Taming Apache Tika JVM & Gotenberg Chromium RAM Usage
Control the ~700-1,160 MB overhead of optional Office document conversion or disable both containers cleanly on PDF-only hosts.
Saves 700-1,160 MB RSS When Disabled · Hard Docker Limits
Why Small VPS Nodes Crash on Tika + Gotenberg
By default, Apache Tika reserves a generous JVM heap and Gotenberg spawns headless Chromium tabs for DOCX/XLSX/HTML rendering. On 2 GB InterServer 1-Slice nodes, keeping both enabled leaves less than 900 MB for Postgres and Tesseract.
Bound Heap & Recycle Chromium
When Office conversion is required, pass _JAVA_OPTIONS=-Xmx384m to Tika and set memory limits in docker-compose.yml so a single 50 MB spreadsheet triggers graceful task retry instead of a host-wide OOM kill.
Measured Thresholds & Container Limits
| Container | Idle RSS | Peak Conversion Spike | Recommended Limit |
|---|---|---|---|
| apache/tika | ~340 MB | ~540 MB (large XLSX) | 576M + _JAVA_OPTIONS=-Xmx384m |
| gotenberg/gotenberg:8 | ~240 MB | ~620 MB (Chromium render) | 640M + --chromium-restart-count=10 |
| Combined Office Plane | ~580 MB | ~1,160 MB | Omit if scanning PDFs/images only |