-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Memory leak in __hash__() #55
Comments
Thank you for the report. It's quite normal that v1 has not this problem, since it was in pure Python. Also the pure py package is not affected by this leak. You can see it using I suppose the problem is in import resource
import frozendict
print("frozendict version:", frozendict.__version__)
print()
c = 0
while True:
fz = frozendict.frozendict({i: i for i in range(1000)})
hash(fz)
if (c % 10000) == 0:
max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
print(f"iteration: {c}, max rss: {max_rss} kb")
c += 1 |
It should be fixed in Can you confirm? |
Yes, it seems to work. Thanks for the fast turn-around! PS: Can you publish to conda-forge when you get the chance? |
Thank you for the report. I suppose I have to add to debug.py a memory leak tracer, as I wrote in the TODO list.
Emh. frozendict-feedstock no more automatically updates when a new version is published to Pypi, from when I played a little with configuration. I have to ask help to someone. |
Done. Unluckily it seems I can't have a noarch package alongside the C Extension on Conda without breaking the bot... |
Thanks, I appreciate it. |
Welcome! You should write in your Bug Report:
I found a case where
frozendict
does not free memory. The old v1 implementation does free memory in this situation.OS version (https://www.google.com/search?channel=fs&q=check+os+version&ie=utf-8&oe=utf-8):
your OS version
Python3 version (python3 -V -V):
your Python version
3.7.6
Steps to reproduce:
Actual result (with the python stack trace if present):
the result you see
Note that this will use up memory rather fast on your machine.
The text was updated successfully, but these errors were encountered: