Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1fd95d3

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

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎lib/matplotlib/_pylab_helpers.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_pylab_helpers.py
+4-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.