Skip to content

Conversation

@Suor
Copy link
Contributor

@Suor Suor commented Dec 24, 2021

@memoize() memory lives as long as decorated function lives, which is
permanent in this case. Since self is referenced as a memory key no
Index will ever be freed.

Changed to use @cached_property who's cache lives as long as the
parent instance.

NOTE: This is an issue for Studio since we are parsing many commits in a long running process.

@Suor Suor requested review from efiop and skshetry December 24, 2021 10:15
@Suor Suor requested a review from a team as a code owner December 24, 2021 10:15
`@memoize()` memory lives as long as decorated function lives, which is
permanent in this case. Since `self` is referenced as a memory key no
`Index` will ever be freed.

Changed to use `@cached_property` whose cache lives as long as the
parent instance.
@Suor Suor force-pushed the index-memory-leak branch from 59d8cfc to 65dff96 Compare December 24, 2021 10:27
@efiop efiop merged commit 9ee428e into main Jan 3, 2022
@efiop efiop deleted the index-memory-leak branch January 3, 2022 11:41
@efiop efiop added the bugfix fixes bug label Jan 3, 2022
@skshetry
Copy link
Collaborator

skshetry commented Jan 4, 2022

btw @Suor, how did you figure/debug this out? This must have been tricky.

@Suor
Copy link
Contributor Author

Suor commented Jan 10, 2022

I used objgraph mostly, can't find the original article but its docs are actually better. Also, used memory profiling a bit. It took some time for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants