Skip to content
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

Unreasonably high CPU load even when idle #400

Closed
tronje opened this issue Apr 17, 2021 · 2 comments
Closed

Unreasonably high CPU load even when idle #400

tronje opened this issue Apr 17, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tronje
Copy link

tronje commented Apr 17, 2021

I'm using neovim with ALE, and texlab. When I open a .tex file, after a few seconds, my CPU load increases dramatically, and it seems that texlab has spawned (CPU count - 1) child processes. I'm not doing anything else in my editor, i.e. it's not just generating high CPU load when I'm actively typing and texlab would be looking for completions, but the editor can be completely idle.
There's also no obvious trigger; I just open a file with nvim file.tex, and don't do anything else. After a few seconds, the processes spawn and CPU load goes through the roof.

I suspected this could be an issue with ALE, but since it's not multiple independent texlab processes, but rather many child processes of texlab, I thought it would be more likely an issue with texlab. However, if I simply run texlab in a terminal, the issue does not occur. So it may still have something to do with how ALE interacts with texlab. Maybe it only triggers after an initial RPC has been performed.

#186 could perhaps be related, though I'm not seeing any chktex processes, just texlab.

Here's a screenshot of htop while the issue is occurring:
Screenshot_20210417_091417

And here's some information:

  • OS: Linx (Arch Linux), kernel 5.11.13
  • texlab version: 2.2.2-1 (installed with system package manager)
  • nvim version: v0.4.4 (release build)
  • ALE version: 1c90d8c (current master branch)

To end on a positive note, I'm otherwise really happy with texlab, it's a treat! 🙂

@pfoerster
Copy link
Member

Thanks for the very detailed report. I am bit surprised that texlab is called so much. I am not aware of any IPC that we are doing so it is definitely a bit odd. Can you try the following PR (#408) and see if it maybe fixes the issue?. Note that it is a bit incomplete at the moment and there may be some regressions but I swapped out the lsp layer with a different crate so this may help.

@pfoerster pfoerster added the bug Something isn't working label May 8, 2021
@pfoerster pfoerster self-assigned this May 8, 2021
@tronje
Copy link
Author

tronje commented May 8, 2021

Hey, thanks for your response! #408 did indeed fix the issue 🙂

texlab still spawns a bunch of child processes, but they no longer consume a lot of CPU time. I'm seeing some small CPU spikes while I'm writing, as it's looking for completions, but when the editor is idle, the CPU load is now negligible. Perfect! I'll close this issue, and thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants