8000 Revert full GC collect · matplotlib/matplotlib@1fd95d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fd95d3

Browse files
Revert full GC collect
based on suggestion from code review
1 parent 589038c commit 1fd95d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/_pylab_helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def destroy(cls, num):
6666
manager.canvas.mpl_disconnect(manager._cidgcf)
6767
manager.destroy()
6868
del manager, num
69-
gc.collect()
69+
# 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)
7073

7174
@classmethod
7275
def destroy_fig(cls, fig):

0 commit comments

Comments
 (0)
0