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

Uses 100% of one core after opening #251

Closed
rchl opened this issue May 13, 2021 · 7 comments
Closed

Uses 100% of one core after opening #251

rchl opened this issue May 13, 2021 · 7 comments

Comments

@rchl
Copy link

rchl commented May 13, 2021

Problem/Motivation

The addon starts using 100% of one CPU core right after opening (without any files open even) and keeps using 100% CPU even after not being open anymore. This seems to eventually result in using all RAM memory and freezing the raspberry PI.

Expected behavior

No runaway CPU or memory issue.

Actual behavior

100% of one core used and eventually freezing PI.

Steps to reproduce

  1. Click the addon's icon in the panel to open it in ingress mode.
  2. Check the CPU usage of the addon right after opening, then after a minute and then after closing the ingress view.

The CPU usage here stays at 25% (100% of one core) at all times.

It is possibly relevant that I've customized one option: config_path: /

Screenshot 2021-05-13 at 22 33 29

I'm on Raspberry PI 4 with 4GB of RAM.
Before opening the VSCode addon, the system-level CPU usage is at 2% and memory usage is at 30%.
After opening the addon the CPU usage jumps to 30% and memory usage is slowly increasing until it reaches 100% and freezes the machine.

HA and addons are at latest versions.

@rchl
Copy link
Author

rchl commented May 13, 2021

Tried with config_path: /config now and that actually resolves the issue.

Not sure if it should be treated as a bug then. I guess having the whole disk contest in the project might make VSCode try to index everything and I can see how this could be very memory and CPU heavy.

But maybe the issue is due to some of the bundled extensions in which case it might still be a valid issue.

@sinclairpaul
Copy link
Member

VSCode uses filewatchers to see changes in files, so it's probably best not to index the whole filesystem of the container, especially on a Pi. I would say its fair to close this?

@rchl
Copy link
Author

rchl commented May 13, 2021

Ideally we would check what exactly causes the issue before closing.

I would maybe not expect file watcher to cause such a bad issue (first 100% CPU then eventually use all the memory).

I don't see a way to disable bundled extensions. I would like to try to do that at least.

@frenck
Copy link
Member

frenck commented May 13, 2021

/
Is a very bad idea and will cause issues. No need to solve that from our end.

@frenck frenck closed this as completed May 13, 2021
@rchl
Copy link
Author

rchl commented May 14, 2021

Also I've just realized that I can set config_path to /root to expose all HA configuration folders which was my original reason for changing the default.

@mpcaddy
Copy link

mpcaddy commented May 28, 2021

I had this too, but I think it was something that had created a symlink so there was a symlink from /config/config to /config. So whatever created that symlink caused a recursive loop. When I removed this my cpu usage went back down.

@frenck
Copy link
Member

frenck commented May 28, 2021

Sorry to hear that @mpcaddy, but that isn't related to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants