[issue44310] lru_cache memory leak

2021-06-04 Thread Wouter De Borger


Change by Wouter De Borger :


--
type:  -> resource usage

___
Python tracker 
<https://bugs.python.org/issue44310>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44310] lru_cache memory leak

2021-06-04 Thread Wouter De Borger


New submission from Wouter De Borger :

# 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.

--
components: Library (Lib)
messages: 395075
nosy: Wouter De Borger2
priority: normal
severity: normal
status: open
title: lru_cache memory leak
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 
<https://bugs.python.org/issue44310>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39168] Generic type subscription is a huge toll on Python performance

2020-01-13 Thread Wouter De Borger


Change by Wouter De Borger :


--
nosy: +Wouter De Borger

___
Python tracker 
<https://bugs.python.org/issue39168>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com