This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Wouter De Borger2
Recipients Wouter De Borger2
Date 2021-06-04.11:45:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org>
In-reply-to
Content
# Problem

the functools.lru_cache decorator locks all arguments to the function in memory (inclusing self), causing hard to find memory leaks. 

# Expected  

I had assumed that the lru_cache would keep weak-references and that when an object is garbage colected, all its cache entries expire as unreachable. This is not the case.

# Solutions 

1. I think it is worth at least mentioning this behavior in de documentation. 
2. I also think it would be good if the LRU cache actually uses weak references. 

I will try to make a PR for this.
History
Date User Action Args
2021-06-04 11:45:58Wouter De Borger2setrecipients: + Wouter De Borger2
2021-06-04 11:45:58Wouter De Borger2setmessageid: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org>
2021-06-04 11:45:58Wouter De Borger2linkissue44310 messages
2021-06-04 11:45:57Wouter De Borger2create