You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I think, since the globals dict gets stored in the function object, and then the function object gets stored in the globals. I think we could get around that by clearing module globals on interpreter shutdown like CPython does, but that would require a defined "interpreter shutdown" phase.
Activity
carbotaniuman commentedon Dec 29, 2020
This is intentional, we don't have a GC implemented in RustPython yet, so any refernce cycles automatically leak memory.
dralley commentedon Dec 29, 2020
Does simply calling or defining a function create a reference cycle, though?
coolreader18 commentedon Dec 29, 2020
Yes, I think, since the globals dict gets stored in the function object, and then the function object gets stored in the globals. I think we could get around that by clearing module globals on interpreter shutdown like CPython does, but that would require a defined "interpreter shutdown" phase.
fanninpm commentedon Oct 25, 2021
I think the most natural place for that would be a custom
Dropimpl for eitherInterpreterorVirtualMachine.