Skip to content

Huge memory usage in Linux and OSX (Not tested in windows) #233

Open

Description

@ricwtk

I have installed this module in Ubuntu 16.04 and Mac OSX El Capitan. In both OS, when I open a python file and start typing, a python process is spawned and the memory usage of the process keep increasing until it saturates all the RAM. This goes away immediately when I disable the module.

Activity

  1. changed the title [-]Huge memory usage in Linux[/-] [+]Huge memory usage in Linux and OSX (Not tested in windows)[/+] on Sep 13, 2016
  2. sadovnychyi commented on Sep 13, 2016

    @sadovnychyi
    Member

    Is it with same project or different ones? Can you enable logging in package settings and look what's going on?

  3. ricwtk commented on Sep 13, 2016

    @ricwtk
    Author

    It happens when autocomplete-python start to serialize requests to jedi. I just realize that it only happens when wx is used.

  4. chxxpeng commented on Sep 22, 2016

    @chxxpeng

    Actually I've meet the same problem in Windows 8.1 Python 2.7.12.
    It happens for all my different projects.
    When I enable the package autocomplete-python, 20mins later, the process python.exe will use huge memory and CPU usage. When disable the package, all work well.

  5. sadovnychyi commented on Sep 22, 2016

    @sadovnychyi
    Member

    As long as I cannot reproduce it I'm afraid I cannot do anything.

  6. ivasonn commented on Nov 2, 2016

    @ivasonn

    @sadovnychyi try to disable "Show Descriptions"

  7. sadovnychyi commented on Nov 2, 2016

    @sadovnychyi
    Member

    @ivasonn wow, that's useful info, thanks.

    I can confirm that with enabled "Show Descriptions" I have ~50mb memory usage after typing import and I'm getting list of all my packages in less than a second, while with disabled "Show Descriptions" it takes tens of seconds and uses 1.3gb of ram.

  8. sadovnychyi commented on Nov 2, 2016

    @sadovnychyi
    Member

    Fixed the huge difference in time while loading list of modules after you type import keyword.

    time python lib/completion.py '{"id":"0","prefix":" ","lookup":"completions","source":"import ","line":0,"column":7,"config":{"showDescriptions":false}}'
    real    0m1.291s
    user    0m1.037s
    sys 0m0.172s
    
    time python lib/completion.py '{"id":"0","prefix":" ","lookup":"completions","source":"import ","line":0,"column":7,"config":{"showDescriptions":true}}'
    real    0m1.078s
    user    0m0.919s
    sys 0m0.147s

    It took tens of seconds before fix to get a completion with descriptions turned off.

    It's still going to take a while for huge modules like tensorflow though. With both config variations.

    time python lib/completion.py '{"id":"0","prefix":" ","lookup":"completions","source":"import tensorflow\ntensorflow.","line":1,"column":11,"config":{"showDescriptions":false}}'
    real    0m30.721s
    user    0m27.276s
    sys 0m1.437s
    
    time python lib/completion.py '{"id":"0","prefix":" ","lookup":"completions","source":"import tensorflow\ntensorflow.","line":1,"column":11,"config":{"showDescriptions":true}}'
    real    0m23.345s
    user    0m21.873s
    sys 0m0.776s
  9. sadovnychyi commented on Nov 2, 2016

    @sadovnychyi
    Member

    Please try it with 1.8.10. Should be better now if you have "Show Descriptions" turned off.

  10. 4 remaining items

  11. lunchboxmg commented on Dec 20, 2016

    @lunchboxmg

    I have been experiencing the same problem on Windows. Anytime I tried to use autocomplete on an object that was subclassed from a wx object, within seconds, all my ram would be gone. But, i realized I had two versions of wxpython installed (2.8 and 3.0). Uninstalled the 2.8 version and have no problems now.

  12. seddarj commented on Feb 17, 2017

    @seddarj

    I've been having a similar issue.

    I use ubuntu 16.04 and the autocomplete process sometimes ramps up to 100% CPU load and starts eating up all of my RAM at a pretty steep rate.

    I've pinned it down to when I'm working with the gnuradio module which is probably quite big.

  13. devuberoi commented on Feb 21, 2017

    @devuberoi

    I've been experiencing this too, my Macbook's fans started to make noise. When I checked Activity Monitor, a python process was consuming almost 100% CPU.

    output of : ps aux | grep python

    USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
    myuser 55563 100.0 0.0 2484232 852 ?? R 5:31PM 183:59.62 /Users/myuser/Projects/env/bin/python /Users/myuser/.atom/packages/autocomplete-python/lib/completion.py

    does it have anything to do with python virtual environments?

  14. sadovnychyi commented on Feb 21, 2017

    @sadovnychyi
    Member
  15. sadovnychyi commented on May 10, 2017

    @sadovnychyi
    Member

    @andrasikladi unfortunately right now there's no way to limit the Jedi in number of completions to returns, see that issue. Until it's fixed, there's nothing I can do about it.

    Maybe you could modify the Regex to trigger Autocompletions setting to ignore completions from that specific module, but I'm not sure that it will work. (e.g. there's no context available, only current word)

  16. mkatliar commented on Jul 21, 2017

    @mkatliar

    I have the same issue when working on a project that uses wx package.

  17. grantstephens commented on Sep 4, 2017

    @grantstephens

    I am having the same issue- not using jedi (unless this installs it in the background) though. Ubuntu 17.04 and autocomplete-python 1.10.2. Atom 1.19.3. Mine is both memory and 100% CPU for each instance of atom, i.e. 4 instances, 4 cores at 100%.

  18. bitinerant commented on Sep 14, 2017

    @bitinerant

    The first time I tried this, it hard-froze my Ubuntu 16.04 laptop. Subsequent tries worked, but used almost all of my 8GB of RAM until I disabled "Show Descriptions".

    Maybe, until this is fixed, "Show Descriptions" should be disabled by default.

    To reproduce:

  19. anxuae commented on Nov 7, 2017

    @anxuae

    Do you have any news about this topic?

    Even with "Show Descriptions" disabled, the issue is still present.
    The only way to solve it, it's to disable autocomplete-python for projects which use wx.

  20. sadovnychyi commented on Nov 7, 2017

    @sadovnychyi
    Member

    Cannot do anything until davidhalter/jedi#805 is fixed. Even if you run pure Jedi on wx completion it will eat your memory and CPU.

    It's also currently not possible to use triggerCompletionRegex setting to ignore some package completions, since the prefix provided by Atom excludes everything after a dot. E.g. for wx. the prefix is just a dot. So you can either completely disable completions on dot by removing the dot match from that regexp, OR we could try to modify the prefix on the fly so you could be more flexible on what you can ignore with that regexp.

    The only solution right now is to disable autocomplete after a dot character by using this regexp:

    ([ (]|[a-zA-Z_][a-zA-Z0-9_]*)

    Put it into Regex To Trigger Autoocmpletions setting. This should limit the number of completions you get. (hopefully! didn't try it by myself)

  21. elliott-beach commented on Feb 10, 2018

    @elliott-beach

    The Visual Studio Code extension for Python, which also uses Jedi, just dealt with this by restarting the competition process if it uses more RAM than a maximum defaulting to 1 GB (microsoft/vscode-python#744).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions