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

High CPU when Robot Framework Language is loaded in Pycharm #350

Closed
cookindutch opened this issue May 14, 2021 · 10 comments
Closed

High CPU when Robot Framework Language is loaded in Pycharm #350

cookindutch opened this issue May 14, 2021 · 10 comments
Labels
bug Something isn't working robotframework-ls

Comments

@cookindutch
Copy link

When I installed the Robot Framework Language in Pycharm the CPU usage went from 3% to 25% - 36% continuously. This also causes my fans to run all the time.

To Reproduce
Steps to reproduce the behavior:

  1. Install Robot Framework Language
  2. Restart PyCharm and wait.

Expected behavior
No significant change in processor activity should happen when sitting idle.

Screenshots
image

Versions:

  • OS: Windows 10
  • Robot Framework Language Server Version 0.16.0
  • PyCharm 2021.1.1
@fabioz
Copy link
Collaborator

fabioz commented May 14, 2021

Can you expand to show the contents of the process below PyCharm in the task manager?

-- I'm curious to know which process is taking up the CPU usage in your use-case.

Something as:

image

@cookindutch
Copy link
Author

image

@cookindutch cookindutch changed the title Hi CPU when Robot Framework Language is loaded in Pycharm High CPU when Robot Framework Language is loaded in Pycharm May 14, 2021
@fabioz
Copy link
Collaborator

fabioz commented May 17, 2021

Is it possible for you to attach a profiler and send me the related pstats files from that?

To do that, please do the following:

  1. Install PyVmMonitor (download it at: https://www.pyvmmonitor.com/download.html) -- you can use the 15 days trial.
  2. Attach it to the process which has the high CPU usage (following the steps from: https://www.pyvmmonitor.com/attach_to.html). Note: you can right-click the tabs in the process explorer and select PID so that you know which PID should be profiled.
  3. Save the pstats and attach them to this issue.
    i.e.:
    image

@robocorp robocorp deleted a comment from cookindutch May 17, 2021
@robocorp robocorp deleted a comment from cookindutch May 17, 2021
@cafe88
Copy link

cafe88 commented May 19, 2021

I hope i've done this right. If not, please let me know ;-)

This is the log from one of the four Python processes which lead to high cpu load

test.zip

@fabioz
Copy link
Collaborator

fabioz commented May 19, 2021

Thanks for the logs... apparently the filesystem polling is responsible for that.

I guess the filesystem polling is too tied to work well on my system. Also, apparently there's polling from several processes at once.

I'm working on fixing this (both with a better polling algorithm -- or using native filesystem notifications when possible -- to work better on other machines and to make the polling work on a single process and have other processes talk to it instead of having polling in multiple processes).

@cafe88
Copy link

cafe88 commented May 19, 2021

Thank you for the quick reply!
Maybe I have another useful information for you:

I've set up a test robot-file with only one Test case with only one Log in it (especially without using additional Libraries) and that does not seem to be a problem, no high CPU load.
If i can help you with any other information, please feel free to tell me what you need.

@fabioz
Copy link
Collaborator

fabioz commented May 19, 2021

Yeap, the filesystem polling speed is pretty much related to the number of files you have under the workspace, so, on tiny projects it shouldn't be a problem.

@fabioz fabioz closed this as completed in 13847a9 May 22, 2021
@fabioz
Copy link
Collaborator

fabioz commented May 22, 2021

This should be fixed in version 0.17.0 (which I hope to release next week).

@cafe88
Copy link

cafe88 commented May 25, 2021

Seems to be working fine, thank you very much for your quick reaction!

@cookindutch
Copy link
Author

cookindutch commented May 25, 2021 via email

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

No branches or pull requests

3 participants