Skip to content

Conversation

tacaswell
Copy link
Member

This leads to caching the tracebacks which can keep user's objects in local namespaces alive indefinitely. This can lead to very surprising memory issues for users and will result in incorrect tracebacks.

Responsive to #25406

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)

This leads to caching the tracebacks which can keep user's objects in local
namespaces alive indefinitely.  This can lead to very surprising memory issues
for users and will result in incorrect tracebacks.

Responsive to matplotlib#25406
@tacaswell tacaswell added this to the v3.7.2 milestone Mar 15, 2023
This is to help prevent reference cycles between the frames and the locals in
that frame.

While garbage collection should in most cases take care of this eventually, we
can help the interpreter out and break the cycle before we return.
@tacaswell tacaswell force-pushed the fix/donot_cache_exceptions branch from 7d5d486 to 01390c5 Compare March 15, 2023 19:54
@tacaswell
Copy link
Member Author

Manually confirmed that the new test passes on pypy3.

@timhoffm timhoffm merged commit 72accb1 into matplotlib:main Mar 15, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 15, 2023
@tacaswell tacaswell deleted the fix/donot_cache_exceptions branch March 15, 2023 23:08
ksunden added a commit that referenced this pull request Mar 16, 2023
…470-on-v3.7.x

Backport PR #25470 on branch v3.7.x (FIX: do not cache exceptions)
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.

3 participants