Title: [Bug]: plt.figure(), plt.close() leaks memory · Issue #23701 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: plt.figure(), plt.close() leaks memory · Issue #23701 · matplotlib/matplotlib
X Title: [Bug]: plt.figure(), plt.close() leaks memory · Issue #23701 · matplotlib/matplotlib
Description: Bug summary MWE: import matplotlib.pyplot as plt while True: plt.figure() plt.close() Either run this code and monitor the mem consumption on top, or run mprof run test.py mprof plot (with memory-profiler) to get Might be related to #224...
Open Graph Description: Bug summary MWE: import matplotlib.pyplot as plt while True: plt.figure() plt.close() Either run this code and monitor the mem consumption on top, or run mprof run test.py mprof plot (with memory-p...
X Description: Bug summary MWE: import matplotlib.pyplot as plt while True: plt.figure() plt.close() Either run this code and monitor the mem consumption on top, or run mprof run test.py mprof plot (with memory-p...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23701
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: plt.figure(), plt.close() leaks memory","articleBody":"### Bug summary\r\n\r\nMWE:\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nwhile True:\r\n plt.figure()\r\n plt.close()\r\n```\r\n\r\nEither run this code and monitor the mem consumption on top, or run\r\n```\r\nmprof run test.py\r\nmprof plot\r\n```\r\n(with [memory-profiler](https://pypi.org/project/memory-profiler/)) to get\r\n\r\n\r\n\r\nMight be related to https://github.com/matplotlib/matplotlib/issues/22448.\r\n\r\n### Operating system\r\n\r\nUbuntu 22.10\r\n\r\n### Matplotlib Version\r\n\r\n3.5.3\r\n\r\n### Matplotlib Backend\r\n\r\nGTK4Agg\r\n\r\n### Python version\r\n\r\n3.10.6\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\npip","author":{"url":"https://github.com/nschloe","@type":"Person","name":"nschloe"},"datePublished":"2022-08-22T07:54:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/23701/matplotlib/issues/23701"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:98b0b325-ed55-f0a5-db47-c97b7931cec9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B890:2C0BEA:1A5C3D:228923:6A5185EB |
| html-safe-nonce | 2992647e1a8280247df6fa12fe1b66fe398bdf9e13e1b6fe832b06fd0c5754cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODkwOjJDMEJFQToxQTVDM0Q6MjI4OTIzOjZBNTE4NUVCIiwidmlzaXRvcl9pZCI6Ijc4OTM1ODQxMDI5MDQ5MjM2MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 902e351900625aad47c273e466f7211be4a50eed5efdda3f6ef6730d1b88ae0a |
| hovercard-subject-tag | issue:1345976446 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/23701/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cba136c60d88fdbfb0654fb1c83669b2ab94a6e03c2960ea39f5419e0aa49940/matplotlib/matplotlib/issues/23701 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cba136c60d88fdbfb0654fb1c83669b2ab94a6e03c2960ea39f5419e0aa49940/matplotlib/matplotlib/issues/23701 |
| og:image:alt | Bug summary MWE: import matplotlib.pyplot as plt while True: plt.figure() plt.close() Either run this code and monitor the mem consumption on top, or run mprof run test.py mprof plot (with memory-p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nschloe |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cb77a7b8b06cd86c243be33fd8e7922d70a9d243 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width