Memory leak in Network
egbertbouman opened this issue · 1 comments
When letting IPv8 run for about 1,5 days, I'm seeing a lot of IPv4 addresses in the Network
class. For instance, in Network.reverse_intro_lookup
I have 2009 keys (despite the 500 cache limit), while the total sum of all objects in the lists is 113163.
Memory leaks in other dicts within this class may also exist, but so far I've only seen issues with reverse_intro_lookup
.
Note that despite these numbers, it takes a while before this actually has a significant impact on memory usage. This will only affect users who run IPv8 24/7.
Thanks for this report. It seems that the reverse_intro_lookup
does not respect the cache size when adding peers here:
py-ipv8/ipv8/peerdiscovery/network.py
Lines 140 to 142 in dfdcfdd
It is supposed to check the current cache size and pop old peers when the cache limit is reached, like this:
py-ipv8/ipv8/peerdiscovery/network.py
Lines 313 to 315 in dfdcfdd