Jacob Walls
Jacob Walls
I think Däniel's solution is the same as Marc's suggested [here](https://github.com/PyCQA/astroid/pull/1741#issuecomment-1220971600), just not using the underscore. (Which makes sense, it has to be public at least to pylint to let...
> My first thought would be to make .parent a weakref to test whether that would have an impact, but that isn't really feasible... I think that's exactly what's going...
Yep, 3.0 or nothing! ;)
`music21` has a very similar use case, with a set of weakref tools [here](https://github.com/cuthbertLab/music21/blob/aacc7aa37552f216a698d8af9e5ea3c685cf8cc2/music21/common/weakrefTools.py), and then (in some cases) properties for syntactic sugar when setting / retrieving parents. One track...
Yep, I'm already seeing some promising results. Looking to do a sequence of small PRs.
Here's a version of Daniel's script from https://github.com/PyCQA/astroid/issues/1780#issuecomment-1245592744 that takes care to delete the references created in the measurements: ```python import gc from pylint.lint import Run from pympler import muppy...
Looks like we've solved the node leaking, just dicts are left: ```shell $ python3 memory.py -------------------------------------------------------------------- Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) Nodes INC: 102907...
The remaining uses seem to derive from the custom caching decorator in astroid. Looking into converting those uses to just `cached_property`.
If we want to close this out, here are some next steps for 3.0. The two remaining offenders are `_get_assign_nodes()` and `slots()`. We can covert them to `cached_property`, but we'll...
Oh, right, and `_get_assign_nodes` is private, duh! Edited to-do list.