-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[Bug]: GPU memory leak with plt.figure() #22448
Copy link
Copy link
Closed as not planned
Labels
GUI: tkPerformancestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Action
Metadata
Metadata
Assignees
Labels
GUI: tkPerformancestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Action
Bug summary
There seems to be a GPU memory leak when calling
plt.figure()andplt.close()repeatedly in matplotlib version3.5.0. Every time these two lines are ran, more and more GPU memory gets hogged up.Code for reproduction
Actual outcome
When inspecting memory usage, more and more GPU memory gets hogged up. Specifically, I ran
nvidia-smi -l 1and observed Memory-Usage increasing until it hits the GPU memory limits, which is when the process crashes.Expected outcome
GPU memory usage should not be going up every iteration of this for loop.
Additional information
This is an issue in matplotlib version
3.5.0, but not3.0.3.Operating system
Ubuntu
Matplotlib Version
3.5.0
Matplotlib Backend
TkAgg
Python version
3.9.10
Jupyter version
6.4.8
Installation
pip