FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MNT: optionally collect gc in memleak.py by richardsheridan · Pull Request #25500 · matplotlib/matplotlib · GitHub

Repository navigation

MNT: optionally collect gc in memleak.py - #25500

Closed
richardsheridan wants to merge 1 commit into
matplotlib:mainfrom
richardsheridan:memleak_no_gc_collect
Closed

richardsheridan wants to merge 1 commit into
matplotlib:mainfrom
richardsheridan:memleak_no_gc_collect

Conversation

Copy link
Copy Markdown
Contributor

PR Summary

Follow up to #23712. It's quite enlightening to see the effect of collecting or not collecting on this test script.

richardsheridan changed the title optionally collect gc in memleak.py MNT: optionally collect gc in memleak.py Mar 19, 2023

QuLogic commented Mar 20, 2023

Copy link
Copy Markdown
Member

It was previously on always, but this now disables it by default. Do we want to change that? The release manager guide probably needs an update as well.

Copy link
Copy Markdown
Contributor Author

I figure the script should reflect the way memory grows in matplotlib, and subsequent to #23712 that means not interfering with gc heuristics.

I left the gc option available since it now takes a while to observe the long term trend and someone may want to smooth out the gc bumps for a short term measurement.

ksunden commented Mar 21, 2023

Copy link
Copy Markdown
Member

For context, the output is actually quite qualitatively different (I did a shorter 100 test rather than the standard from the release docs which is 1000, but still)

Without explicit gc.collect:

With explicit gc.collect:

So, without calling gc.collect, memory usage is higher and pymalloc/total objects oscillate with a period of ~4.
While calling gc.collect, memory usage and number of objects grow fairly linearly. (iirc they do plateau off further in, but takes longer to get to that plateau at least for rss)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL