We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 589038c commit 1fd95d3Copy full SHA for 1fd95d3
lib/matplotlib/_pylab_helpers.py
@@ -66,7 +66,10 @@ def destroy(cls, num):
66
manager.canvas.mpl_disconnect(manager._cidgcf)
67
manager.destroy()
68
del manager, num
69
- gc.collect()
+ # Full cyclic garbage collection may be too expensive to do on every
70
+ # figure destruction, so we collect only the youngest two generations.
71
+ # see: https://github.com/matplotlib/matplotlib/pull/3045
72
+ gc.collect(1)
73
74
@classmethod
75
def destroy_fig(cls, fig):
0 commit comments