Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可能出现的内存泄露 #1654

Open
Skyer19 opened this issue Feb 5, 2025 · 1 comment
Open

可能出现的内存泄露 #1654

Skyer19 opened this issue Feb 5, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Skyer19
Copy link

Skyer19 commented Feb 5, 2025

Description of the bug | 错误描述

您好,在使用代码时,发现有可能出现的内存泄露,详细请查看复现过程,谢谢。

How to reproduce the bug | 如何复现

使用 memory_profiler 对 示例代码进行检测,发现在 pipe.pipe_analyze() , 会出现内存不回收,导致server 内存占用越来越大,log 如下所示:

第n次使用:

97   4021.4 MiB      0.0 MiB           1           if len(model_json) == 0:
98   4499.9 MiB    478.4 MiB           1               pipe.pipe_analyze()  # 解析
99   4499.9 MiB      0.0 MiB           1               orig_model_list = copy.deepcopy(pipe.model_list)

第n+1次使用:

97   4513.0 MiB      0.0 MiB           1           if len(model_json) == 0:
98   5068.5 MiB    555.5 MiB           1               pipe.pipe_analyze()  # 解析
99   5068.5 MiB      0.0 MiB           1               orig_model_list = copy.deepcopy(pipe.model_list)

Operating system | 操作系统

Linux

Python version | Python 版本

3.11

Software version | 软件版本 (magic-pdf --version)

0.10.6

Device mode | 设备模式

cuda

@Skyer19 Skyer19 added the bug Something isn't working label Feb 5, 2025
@Skyer19
Copy link
Author

Skyer19 commented Feb 5, 2025

我们使用贵实验室的开源代码构建我们自己的工具包,但是内存泄漏可能会给我们未来带来隐患。想请教在发布前的测试是否有出现这个情况,以及是否有办法解决?谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant