Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
There seems to be a GPU memory leak when callingplt.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
frommatplotlibimportpyplotaspltforiinrange(10000):plt.figure()plt.close()
Actual outcome
When inspecting memory usage, more and more GPU memory gets hogged up. Specifically, I rannvidia-smi -l 1
and 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 version3.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