GeezerVison is showing github.com — bpo-1635741: Fix reference cycle by calling explicit gc collection in main interpreter by shihai1991 · Pull Request #21902 · python/cpython
Conversation
shihai1991
commented
Aug 17, 2020
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
shihai1991
changed the title
WIP: explict gc collection in main interpreter
bpo-1635741: explict gc collection in main interpreter
Aug 17, 2020
|
Before this PR:
sys.gettotalrefcount: 14288
sys.gettotalrefcount: 18042
sys.gettotalrefcount: 21796
sys.gettotalrefcount: 25550
sys.gettotalrefcount: 29304
sys.gettotalrefcount: 33058
sys.gettotalrefcount: 36812
sys.gettotalrefcount: 40566
sys.gettotalrefcount: 44320
sys.gettotalrefcount: 48074
After this PR:
sys.gettotalrefcount: 10537
sys.gettotalrefcount: 10540
sys.gettotalrefcount: 10543
sys.gettotalrefcount: 10546
sys.gettotalrefcount: 10549
sys.gettotalrefcount: 10552
sys.gettotalrefcount: 10555
sys.gettotalrefcount: 10558
sys.gettotalrefcount: 10561
sys.gettotalrefcount: 10564
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
shihai1991
changed the title
bpo-1635741: explict gc collection in main interpreter
bpo-1635741: Fix reference cycle by calling explicit gc collection in main interpreter
Aug 17, 2020
|
Merged since it seems to fix multiple issues: #21902 (comment)
Does it fix your issue with encoding names and encodings._aliases?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Merged since it seems to fix multiple issues: #21902 (comment)
Does it fix your issue with encoding names and encodings._aliases?
Yes, this PR have fix my issue. there have no remaining encodings.aliases in refdumps.
Thanks a million, victor. I have learned much in this issue.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I'm not sure that the GC is still fully functionnal after PyInterpreterState is cleared, but at least, it seems like there were a bunch of reference cycles.
cc @pablogsal
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
shihai1991
added a commit
to shihai1991/cpython
that referenced
this pull request
Aug 20, 2020
…honGH-21902)
Fix a reference cycle by triggering an explicit GC collection
after calling PyInterpreterState_Clear().
|
Just curious, what are the three leaks.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Just curious, what are the three leaks.
You found this detail. I checked that some str object own the changed refcount in each iteration(not check the details).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
xzy3
pushed a commit
to xzy3/cpython
that referenced
this pull request
Oct 18, 2020
…honGH-21902)
Fix a reference cycle by triggering an explicit GC collection
after calling PyInterpreterState_Clear().
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|