-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Automatically or manually unload modules to free memory #1340
Comments
Yes, I agree. I'm actually surprised that nobody has brought this up previously. I've known for a while that it's a problem, but a lot of people seem to be working with less modules (myself included). If you want to change something, please consider working on parso's caching mechanism. There's probably the problem. My personal take on it is that we probably have to get rid of "old" parsed modules every once in a while, but I don't really have time to do that at the moment. Jedi itself doesn't really do caching, it's just parso. BTW: One of the issues with Python is that it doesn't really release memory, it just holds it so you can reuse it later. |
Now instead of 3 GB, those processes should take probably like 600MB. I hope that's not too much. But in general, it's just hard to optimize with Python. Let me know if this is OK for you. Long term I might rewrite Jedi in Rust and at that point, it would definitely take less memory (and Rust can free memory as well). |
I installed 1TB of memory on our server as a "workaround". It is still good to know there is a software-based solution. |
LOL. Can you please tell me what you are working on? I would be very interested, because that sounds like an extreme amount of Python files. |
So basically you're working for a competitor of kite.com? Or https://tabnine.com/? |
Exactly |
Is there a product that one can try/look at? |
Dave Halter (10): Make sure to limit the amount of cached files parso stores, fixes davidhalter/jedi#1340 Remove Python 2.6 grammar Get rid of Python 3.3 artifacts Fix a Python 2.7 issue Add a Changelog note about dropping 2.6/3.3 Forgot to increase the pickle version del_stmt is now considered a name definition Add a bit to the changelog Make sure iter_funcdefs includes async functions with decorators, fixes #98 Bump version to 0.6.0 Hugo (4): Drop support for EOL Python 2.6 Drop support for EOL Python 3.3 Add python_requires to help pip Fix string/tuple concatenation Jarry Shaw (2): Revision on assignment errors (#97) Revision on fstring issues (#100) Tim Gates (1): Fix simple typo: utitilies -> utilities
* pythonx/parso fb010f2...c864ca6 (14): > Bump version to 0.6.0 > Make sure iter_funcdefs includes async functions with decorators, fixes davidhalter#98 > Add a bit to the changelog > del_stmt is now considered a name definition > Forgot to increase the pickle version > Revision on fstring issues (davidhalter#100) > Revision on assignment errors (davidhalter#97) > Add a Changelog note about dropping 2.6/3.3 > Fix a Python 2.7 issue > Get rid of Python 3.3 artifacts > Remove Python 2.6 grammar > Merge branch 'rm-2.6' of https://github.com/hugovk/parso > Make sure to limit the amount of cached files parso stores, fixes davidhalter/jedi#1340 > Fix simple typo: utitilies -> utilities
* pythonx/parso fb010f2...c864ca6 (14): > Bump version to 0.6.0 > Make sure iter_funcdefs includes async functions with decorators, fixes davidhalter#98 > Add a bit to the changelog > del_stmt is now considered a name definition > Forgot to increase the pickle version > Revision on fstring issues (davidhalter#100) > Revision on assignment errors (davidhalter#97) > Add a Changelog note about dropping 2.6/3.3 > Fix a Python 2.7 issue > Get rid of Python 3.3 artifacts > Remove Python 2.6 grammar > Merge branch 'rm-2.6' of https://github.com/hugovk/parso > Make sure to limit the amount of cached files parso stores, fixes davidhalter/jedi#1340 > Fix simple typo: utitilies -> utilities
Hi I am using jedi in a service and it processes a lot of code a day. That leads to the issue of a very large memory consumption because all modules are loaded. Each jedi process takes 3Gb of memory and I have 4 such processes. My suggestion is can we have a way to unload less frequently used modules to keep the memory consumption in check?
The text was updated successfully, but these errors were encountered: