Skip to content

Fix memory leak when enabling mkldnn#4148

Merged
Bobholamovic merged 2 commits into
PaddlePaddle:developfrom
timminator:fix-memory-leak
Jun 9, 2025
Merged

Fix memory leak when enabling mkldnn#4148
Bobholamovic merged 2 commits into
PaddlePaddle:developfrom
timminator:fix-memory-leak

Conversation

@timminator

Copy link
Copy Markdown
Contributor

Currently the mkldnn cache is unlimited and not configurable via a config setting. This results in memory leaks when using for example PaddleOCR on a lot of images.
This PR makes this option configurable for tools like PaddleOCR to set a reasonable cache capacity.

Fixes PaddlePaddle/PaddleOCR#15631

@paddle-bot

paddle-bot Bot commented Jun 8, 2025

Copy link
Copy Markdown

Thanks for your contribution!

@Bobholamovic

Copy link
Copy Markdown
Member

Hi, please set the develop branch as the target branch. The updates should be merged into develop, before cherry-picked to the release branch.

@Bobholamovic
Bobholamovic changed the base branch from release/3.0 to develop June 9, 2025 07:36
@Bobholamovic
Bobholamovic changed the base branch from develop to release/3.0 June 9, 2025 07:37
TingquanGao
TingquanGao previously approved these changes Jun 9, 2025
@timminator
timminator changed the base branch from release/3.0 to develop June 9, 2025 08:24
@timminator
timminator dismissed TingquanGao’s stale review June 9, 2025 08:24

The base branch was changed.

@timminator
timminator changed the base branch from develop to release/3.0 June 9, 2025 08:25
@timminator
timminator changed the base branch from release/3.0 to develop June 9, 2025 09:18
@timminator

Copy link
Copy Markdown
Contributor Author

Switching to develop as the target was more difficult then expected. ;-)
@Bobholamovic You made also changes to the file in the meantime, but everything should be good now. @TingquanGao I will rerequest a review from you due to switching the target branch.

@timminator
timminator requested a review from TingquanGao June 9, 2025 09:21
Comment thread paddlex/inference/utils/pp_option.py Outdated
@Bobholamovic
Bobholamovic merged commit 60ae2f5 into PaddlePaddle:develop Jun 9, 2025
Bobholamovic pushed a commit that referenced this pull request Jun 10, 2025
* Fix memory leak when enabling mkldnn

Fix PaddlePaddle/PaddleOCR#15631

* Set default cache capacity to 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak when using PaddleOCR 3.0.1/3.0.0 with argument device=cpu

3 participants