Skip to content
Discussion options

You must be logged in to vote

Pipeline 模式也会出现这种情况的。虽然没有使用 VLM 大模型,但 pipeline 模式内部实际上使用了多个专用模型(DocLayoutYOLO、PaddleOCR、表格检测模型等),这些模型都是通过**单例模式(Singleton)**缓存的。

根据 issue #3617issue #4510 的讨论,这是一个已知问题:

  • 模型资源被单例持有,在长时间运行的 API 服务中无法完全释放
  • 即使调用了 torch.cuda.empty_cache()gc.collect() 也无法释放单例缓存的资源
  • 完全释放内存目前只能通过重启进程

建议的临时解决方案:

  1. 定期重启 mineru-api 服务(比如每天定时重启)
  2. 设置 MINERU_VIRTUAL_VRAM_SIZE 限制 GPU 显存使用
  3. 有用户选择不使用 mineru-api,而是自己封装服务调用命令行工具来实现进程隔离

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu  Join Discord Share on X

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CUsopp
Comment options

@dosubot
Comment options

Answer selected by CUsopp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant