jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 261 forks source link

/usr/bin/python -W ignore -m elpy.__main__ causes heavy CPU usage #724

Open droptablestar opened 8 years ago

droptablestar commented 8 years ago

Running elpy on OS X 10.11.1 and after several minutes of editing a single Python file this process will begin using ~100% of my CPU.

jorgenschaefer commented 8 years ago

Hello, and thank you for the report! What is the output of M-x elpy-config?

This could be a few things. For example, Elpy will index your project to provide completion with jedi/rope or import suggestions with importmagic.

I am afraid I do not know Mac OS X particularly well, so I do not know how to do the equivalent of strace(2) there, but if you do, I would be curious as to what syscalls elpy does there.

droptablestar commented 8 years ago

Apologies for the delay. Output from M-x elpy-config: Elpy Configuration

Virtualenv........: None RPC Python........: 2.7.10 (/usr/bin/python) Interactive Python: python (/usr/bin/python) Emacs.............: 24.4.1 Elpy..............: 1.10.0 Jedi..............: 0.9.0 Rope..............: Not found (0.10.3 available) Importmagic.......: 0.1.3 Autopep8..........: 0.1.3 Syntax checker....: flake8 (/Users/jreese/Library/Python/2.7/bin/flake8)

You have not activated a virtual env. While Elpy supports this, it is often a good idea to work inside a virtual env. You can use M-x pyvenv-activate or M-x pyvenv-workon to activate a virtual env.

The directory ~/.local/bin/ is not in your PATH. As there is no active virtualenv, installing Python packages locally will place executables in that directory, so Emacs won't find them. If you are missing some commands, do add this directory to your PATH.

Options

Square brackets indicate buttons; type RET or click mouse-1 on a button to invoke its action. Invoke [+] to expand a group, and [-] to collapse an expanded group. Invoke the [Group], [Face], and [Option] buttons below to edit that item in another window.

[+]-- [Group] Elpy [+]-- [Group] Python [+]-- [Group] Virtual Environments (Pyvenv) [+]-- [Group] Completion (Company) [+]-- [Group] Call Signatures (ElDoc) [+]-- [Group] Inline Errors (Flymake) [+]-- [Group] Snippets (YASnippet) [+]-- [Group] Directory Grep (rgrep) [+]-- [Group] Search as You Type (ido)

josh

On Nov 25, 2015, at 12:07, Jorgen Schäfer notifications@github.com wrote:

elpy-config

jorgenschaefer commented 8 years ago

Thanks! That looks all pretty sensible – I'm afraid that, outside of running the OS X-specific strace(2), I do not know how to debug this problem :-(

ejmg commented 7 years ago

I'm here to comment that I'm suffering the exact same problem, but it is only with a specific block of code (which is the weird part). Emacs will completely freeze as this background python process takes an entire core and eventually will eat up 2-3 gigs of RAM.

I'm on ubunty 14.04, so let me know if I can be assistance with pinning this down. Killing the process brings back Emacs to normal behavior, so I'm not permanently effected and besides this single block of problem code, elpy works like a charm.

jorgenschaefer commented 7 years ago

That sounds very strange. Might be related to Jedi maybe? If you know how to debug a running process, please do so. It's difficult to do that remotely.

Are you using the latest versions of all packages?

droptablestar commented 7 years ago

I am no longer experiencing this problem.

mattduck commented 7 years ago

For what it's worth I'm seeing something similar too, an elpy.__main__ process regularly consumes 100% CPU - it's been happening since I installed it a few months back.

When I get a chance I'll provide some more concrete info.