长文档解析崩溃
Author: dvjsbdufbvCreated Sep 13, 2026Updated Sep 13, 2026
Labelsbug
Search before asking | 提交之前请先搜索
- I have searched the MinerU Readme and found no similar bug report.
- I have searched the MinerU Issues and found no similar bug report.
- I have searched the MinerU Discussions and found no similar bug report.
Consult the online AI assistant for assistance | 在线 AI 助手咨询
- I have consulted the online AI assistant but was unable to obtain a solution to the issue.
Description of the bug | 错误描述
现象
主进程直接消失,没有任何 traceback、没有 Killed 输出。
任务全部报废,客户端只能看到连接失败(curl 报连接被拒绝)。
同一份文档、同一套配置,仅页数不同,结果不同:
| 页数 | 并发 | 内存峰值(host 压力) | 结果 |
|---|---|---|---|
| 290 | 1 | 25.78 GiB | ✅ 完成 |
| 290 | 2 | 25.97 GiB | 崩溃 |
| 400 | 1 | 25.54 GiB | 崩溃 |
| 400 | 4 | — | 崩溃 |
| 400 | 8 | — | 崩溃 |
"内存峰值"为
MemTotal − MemAvailable(/proc/meminfo),每 5 秒采样。
问题
1. 失败完全静默
主进程被信号杀死时,没有任何机会记录日志或更新任务状态。客户端只能看到连接中断。应该是系统杀了进程。
2. 崩溃点距 cgroup 上限还有约 2.5 GiB
峰值稳定落在 25.5 ~ 26.0 GiB,而 cgroup 限制是 28 GiB。 我们无法确定触发原因 —— 是 cgroup 限制、宿主级 OOM、还是其他机制。
3. 内存随页数增长,且处理期间不释放
400 页实测轨迹(每 5 秒采样,1 秒采样轮次结论一致):
41s 11.3 GiB
101s 17.5 GiB
152s 21.5 GiB
203s 24.7 GiB
253s 25.5 GiB
304s 24.8 GiB
314s 崩溃
4. 缺少输入校验或容量提示
提交超出处理能力的文档时,没有任何预警或拒绝。文档中也没有给出 "内存占用与页数的关系",用户无法预判自己的文档是否可行。
期望行为
- 长文档处理失败时,应该有可归因的错误信息(而不是静默消失)
- 若存在内存上限,应在接近时主动记录日志(页数、窗口进度、当前 RSS), 让崩溃有迹可循
- 文档中给出实测的内存占用与页数关系,或提供容量校验
How to reproduce the bug | 如何复现
环境
| 项 | 值 |
|---|---|
| MinerU | 3.4.4(tag mineru-3.4.5-released) |
| vLLM | 0.20.2 |
| torch | 2.11.0 |
| transformers | 4.57.6 |
| GPU | NVIDIA A10,23028 MiB |
| CPU | 8 vCPU |
| 宿主内存 | 28 GiB |
| cgroup 内存上限 | 28 GiB(cgroup v1) |
| swap | 无 |
| 部署方式 | mineru-api HTTP 服务,--enable-vlm-preload true |
| backend | hybrid-engine |
| 并发 | MINERU_API_MAX_CONCURRENT_REQUESTS=1 |
| 窗口 | MINERU_PROCESSING_WINDOW_SIZE=64(默认值) |
复现步骤
# 1. 启动服务
mineru-api --host 0.0.0.0 --port 8000 --enable-vlm-preload true
# 2. 提交长文档
curl -X POST http://127.0.0.1:8000/tasks \
-F "files=@<654页PDF>" \
-F "backend=hybrid-engine" \
-F "start_page_id=0" \
-F "end_page_id=<页数-1>"
# 3. 轮询
curl http://127.0.0.1:8000/tasks/{task_id}
Operating System Mode | 操作系统类型
Linux
Operating System Version| 操作系统版本
Ubuntu 22.04
Python version | Python 版本
3.12
Software version | 软件版本 (mineru --version)
>=2.5
Backend name | 解析后端
vlm
Device mode | 设备模式
cuda
Source: opendatalab/MinerU