-
Notifications
You must be signed in to change notification settings - Fork 18
[BUG] Memory leak when constructing empty frozendicts #60
Copy link
Copy link
Closed
Labels
Type: BugSomething isn't workingSomething isn't working
Description
Similar to #55, frozendict() and frozendict({}) leak memory.
OS version: Ubuntu 20.04.4 LTS
Python3 version (python3 -V -V): Python 3.8.10
Steps to reproduce
Borrowing code from #55:
import resource
import frozendict
print("frozendict version:", frozendict.__version__)
print()
c = 0
while True:
fz = frozendict.frozendict({})
if (c % 10000) == 0:
max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
print(f"iteration: {c}, max rss: {max_rss} kb")
c += 1Actual result
frozendict version: 2.3.2
iteration: 0, max rss: 11292 kb
iteration: 10000, max rss: 12188 kb
iteration: 20000, max rss: 12980 kb
iteration: 30000, max rss: 13772 kb
...
iteration: 3150000, max rss: 263252 kb
iteration: 3160000, max rss: 264044 kb
iteration: 3170000, max rss: 265100 kb
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working