-
Notifications
You must be signed in to change notification settings - Fork 259
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
jsonserver high RAM usage #638
Comments
Forgot to mention I'm using a 2.7.10 interpreter in a virtualenv |
Python: 3.4.3 in virtualenv ( multiple virtualenvs in multiple sublime windows ) |
I'm on Gentoo also; probably not a factor, but still interesting. I'm using two really big libraries in the virtualenv, wxPython (related to davidhalter/jedi#805 probably) and the Enthought Traits/Pyface libraries. There's also a fair amount of Cython code, but I think Jedi skips over that? |
I will try to reproduce it, things go rogue when two windows are open using the same project is probably logical on Linux as there is only one Unix Domain Socket and two windows trying to start anaconda server over that socket, with only one window is weird. What I can see in the logs is that Jedi breaks. |
Ok I did several crazy things to try to reproduce the logs that @robmcmullen pasted but I was not able to make Jedi go rogue I just exhausted my computer RAM and had to restart. To do so, I had to open 7 windows in a project that was using wxPython, each instance of Jedi that needs to complete wxPython uses 6Gb of memory (I have 32GB on this computer) Jedi seems to use that huge amount of memory always that imports the xwPython module as use iPython demonstrates We have a problem here because the last version of Jedi that is on master, fixed this problem, this is the comparative between the current jedi version bundled into anaconda and the latest one: Anaconda's bundled version: Latest Jedi version: As you can see, is much better but we have a problem with the latest Jedi version but that version caused some performance issues in OSX and I had to rollback it #632 So what we have here is a big problem to me because I do not have the time to hunt down the problem in OSX and update Jedi, apart from that latest version of Jedi API is not compatible with anaconda and I had to modify anaconda to make it work with it so it is not an in-drop replacement and probably that could be causing some issue. I will update this as soon as I have anything to update. P.S: as a suggestion, try to do not open more than one window into the project and if you do use another Python interpreter for the second one, one interpreter that does not see the library that is using too many memory |
Thanks for taking a look at it. Sounds like we can't just plop in the new dev version of Jedi because of the API changes. I'd be willing to try to backport the fix from the current Jedi to the version that is compatible with Anaconda, but I can't find the commit in Jedi that fixes it. Any ideas which commit might have been the resolution? Or was it a series of changes that would be difficult to backport? |
I think is easier if you just use the |
At the jedi_bump branch, it's made a huge difference so far. jsonserver seems to be holding in the 300-400MB range. |
@qocu did you try the |
The same python process has been running for these past 4 days and it has only grown slightly to 500MB. I'd say that it fixes my issue. |
@DamnWidget haven't tried it yet, I'll be working on large projects again ( on small I haven't noticed problems even on master branch ) in couple of days so I will post observations. |
Aaaaand, I jinxed myself. The jsonserver process is currently spinning and growing, but pretty slowly compared to last time. In 4 minutes, it's only at 1.2GB. I couldn't get jsonserver to run in debug mode using jedi_bump, for some reason it would never talk to sublime. I'll try again. |
Got jsonserver running in debug mode. I'll post a followup if it starts spinning again in a few days. |
Could it be related to different projects using the same virtualenv? I have two related projects that I was using the same virtualenv to edit and test, both projects were open and both were getting linted automatically. In debug mode, you specify a single project and it doesn't appear to do any linting or anything of other projects that are also open using the same virtualenv. I'll try a second debug jsonserver for the other project and see what happens. |
On linux you have to use the same name as your project for the |
I worked for several hours with the two projects open (separate jsonserver process for each) and one of them produced this when it started spinning and growing memory:
Clearly it's an issue in Jedi but because it can take hours to trigger. Is there any way to flag the underlying jedi to print out debug info also? |
The strange thing about these logs of yours is that there is no error, just traceback so we do not even know what the problem is. To enable Jedi to print to the stdout just add |
I know, Jedi is just spinning somehow but it's not clear where. I've added the set_debug_function, and also I discovered the sys.settrace hook, so I've added function call tracing for jedi and maybe that will also help pinpoint something. The logs grow by megabytes for each jedi call, so I'll let you know anything interesting if it happens before my filesystem gets full. :) |
I hit it just now. Sifting through 650M of log data, there's the command It seems like jedi is piclking some data and that's really slow in this instance when parsing wxPython. Previous instances don't have this huge time. I think it's time I open a ticket with Jedi. |
What's the likelihood that this is being caused by "from BLAH import *"? There are quite a few of those floating around in the code that I haven't yet refactored out. |
I think the best option here is open a bug in the Jedi repository, my exposure to Jedi internal is not so good but I think |
Haven't run into this issue for a long time now, can't reproduce. |
Closing Sublime Text does not close the process, I have to kill the process specifically. I don't have anything in my console atm because I restarted ST. I'll try to update this issue with more information once I come across it again and have some more information to share. I am getting the following ignored exception pretty often with Python 3.5.3 (which has been resolved in later versions): Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fa0bcb77048>
Traceback (most recent call last):
File "/home/andreas/.pyenv/versions/project/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable I only use star imports for my signal's receivers in Django because those all need to be imported when the Django app is loaded. This is on Python 3.5.3 with the following installs:
|
Anaconda version @AndreasBackx? |
@DamnWidget my apologies, the version I've got is 2.1.20. This is on Arch Linux 4.12.3-1. |
Can you reproduce it as you wish? If so, can I have the code that triggers the issue and an explanation about how to reproduce it? |
I just started working on it again after having the process killed and I'm currently not seeing any elevated process or RAM usage on the server. I'll check more often from now on to get an indication of what might be the issue. |
Okay, Anaconda just made my PC come to a crawl and made me force shutdown it because I couldn't even start to open a terminal in order to shut it down. I noticed the elevated CPU usage in my bar on my desktop and when I started top, it immediately came to a crawling halt and I heard my music playing bit by bit (literally). Chromium was also acting weird because it seemed to be out of memory. For now I still can't provide you with any real code to reproduce the issue, but this project will be open sourced in the future if that is any help at all. :/ I probably caught it at a good time earlier today, but now it probably slurped all of my RAM and swap space and made my PC crash I guess. So it took 32GB of memory on average (16GB RAM and 16GB swap). |
Hi @AndreasBackx |
Alright, I'm starting to tail the file right now and let's hope I notice it before it goes berserk again. |
So far so good. |
Expected Behaviour
jsonserver using a relatively static amount of RAM
Actual Behaviour
jsonserver process increases size, seemingly without bounds until it swaps everything out of memory except itself.
Steps to Reproduce
As noted in #318, and by @qocu it's not clear exactly what is causing it, but it seems to be related to large projects or multiple Sublime windows open in a project
ST3, Anaconda and OS versions
ST3126, Anaconda 2.1.18, linux 4.1.12 kernel
ST3 Console Logs
Nothing useful I expect, but here: st3.txt
Anaconda's JsonServer Logs
I've not had it fail again since this jsonserver log; will update when it happens again. anaconda-traceback.txt
The text was updated successfully, but these errors were encountered: