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
beetsplug web: memory leak #2600
Comments
Thanks for the report! If you have experience reading this output from this memory profiling tool, can you please help interpret its conclusions? I don't see any category consuming any suspiciously large amount of memory… the largest quantity is the total size of |
Hi sampsyo, this is me memory profiling for the first time - sorry, I can't assist much interpreting the results. Thanks |
Sure, that makes sense. But as it stands now, someone will more or less need to go digging from scratch. So please update this ticket if you come up with any more evidence about where to look for a problem. |
Thank you, I'll definitely try to dig myself ;) |
Quick update - adding following to https://github.com/beetbox/beets/blob/master/beetsplug/web/__init__.py results in memory usage being stable:
(clearing connections in dbcore) |
Huh! I don't quite see why the teardown is necessary (vs. just letting the value get deleted), but this can't hurt. Yes, would you mind opening a PR? |
Is this still an issue? Setup
Tested with Python 2.7 and Python 3.6.
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? |
Problem
Memory leak.
Edit - minimal test case:
beet web 127.0.0.1 - - [17/Jun/2017 18:17:46] "GET /album/query/disco HTTP/1.1" 200 -
Repeat the same request and monitor memory usage (python.exe).
JSON result for test case: 365
Memory usage (starting at about 15MB) about 50MB after ~20 requests; memory is not freed.
Real usage eventually results in consuming several hundred megabytes.
Item queries (several thousand results) seem to be fine or at least leaking a lot less.
Troubleshooting attempts:
gc.garbage showing empty list.
pympler :: tracker.print_diff() attached below.
Setup
beets version 1.4.4
Python version 2.7.11
plugins: web
Flask 0.12.2
Same behaviour for Python 3.6.1
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: