I was wondering if anybody else are seeing this.
I don’t get it, it’s been working fine for years.
I tried creating a bug for it, but as usual it just gets brushed off with it being an addon.
I’m running HA on a i5, in a proxmix vm.
It is usually using around 20% CPU, but if I start the studio code server it spikes to 105%.
I have no idea what is going on, and I was wondering if others have seen the problem?
There’s been an open issue for over a year. I have now installed VSC locally on my PC and access HA with it through the Samba addon
Thanks! I reported on it as well, the response is that it’s an addon problem, and thus Frenck just shuts it down, I guess that also the level of attention the addon gets.
It’s only with the HA 2024.xx I’ve seen the problem, or at least enough for me to have a device that went weird.
That’s because it’s VSCode that’s using the resources. Yes the addon is doing it, but VSCode is a memory hog on a normal computer, it’s also something Frenck can’t control because he doesn’t write the vscode software.
You should report the high memory to vscode on their github page. There’s a very good chance that your system isn’t good enough to handle vscode too. It’s a heavy IDE and linting is a hungry process. FYI linting is when the system goes through and auto completes your words, underlines errors, etc.
That github report linked also shows that the memory leak is inside the linting for the HomeAssistant Config helper extension which is not written by home assistant. It’s written by a 3rd party (custom). So that may be where your issue should go, not on the addon.
This is the page you’d write the issue on
Thanks for the explanation. I tried disabling that and it was still the same for me. Working locally works fine for me
if it’s unrelated to the extension, then you’d write the issue against vscode.
Well for me it looks like something change in HA Core.
I don’t do automatic updates, and this has come with a HA update, and not a VSCode update.
The device has 2 i5 cores, and 12 GB of ram, so it should be plenty powerfull even for vscode.
But of course, it’s just a question of giving up on it, and using file editor.
Regardless, the addon is just a docker container running vscode. I get that you don’t understand how it all fits together, but it’s like you blaming apple for the google maps app not finding your house.
I’m with @fribse. My vscode integration on Home Assistant has recently gone nuts and is now using 100% CPU on my system (HA, on Home Assistant Operating System, on Proxmox). I restart it and within a day it’s back up to 100% CPU. Uninstalling the VSCode integration brought my system back to the typical 8% CPU usage.
This appears to be a recent thing, as it was working just fine. I’m thinking it’s potentailly cauased by a HA core change too.
It has nothing to do with HA at all. It is literally just a docker container running vs.code server. The container probably got an update recently and that is what is causing it. Plus, vs.code is known to be a CPU/RAM hog.
I understand what you say, but I too get the same behaviour that VSstudio mostly works fine then randomly will spike to 190% CPU which stops HA from working.
I’ve been using HA since September last year and its only just started doing this on 2024.2 or maybe 2024.3 onwards. I downgraded to an older version of vsstudio and same thing happened. Uninstalled vsstudio and reinstalled it again in case it was a corruption and again it randomly happens.
Key point is that whilst it may be “just” a docker container, it never had this CPU runaway issue for 6 months or so and now it happens every few days. So something in the HA multiverse has caused vsstudio’s memory leak or whatever to become much more prevalent
I’ve ended up writing an automation to detect the high CPU and shutdown vsstudio when it happens which is a right bodge.
The ONLY thing I can think of that would cause that would be the API calls that vs.code does with the HA extension. It could also be a recent update to the vs.code codebase that caused it as well. My desktop version bugs out on me about once every 4 or 5 days if I don’t restart it and that only started happening recently as well. Granted, I have WAY too many extensions loaded.
Hi,
I’m having the same high CPU/memory usage. I’m running VMWARE Esxi 8.0.
The VM is running 5 vCPUs and 8 GIG of memory.
When I start to edit a file, the usage starts at 25% and climbs to 95% over 20 mins. When I restart Vcode server, it drop down to 0% again.
I guess I’ll need to install v studio on my PC, until this is fixed. Too bad, great add on. Below is some logs if anyone is interested.
Thks for any help!!
Add-on: Studio Code Server
Fully featured Visual Studio Code (VSCode) experience integrated in the Home Assistant frontend.
Add-on version: 5.15.0
You are running the latest version of this add-on.
System: Home Assistant OS 12.2 (amd64 / qemux86-64)
Home Assistant Core: 2024.4.3
Home Assistant Supervisor: 2024.04.4
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[18:36:32] INFO: Configuring timezone (America/Chicago)…
Log level is set to DEBUG
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-user: starting
s6-rc: info: service init-mysql: starting
s6-rc: info: service init-mosquitto: starting
s6-rc: info: service init-code-server: starting
s6-rc: info: service init-code-server successfully started
s6-rc: info: service init-mysql successfully started
s6-rc: info: service init-user successfully started
s6-rc: info: service code-server: starting
s6-rc: info: service code-server successfully started
I was having this issue. VS Code would keep using more and more resources forever, even after navigating away from it. However, I switched my workspace to only be /config instead of having all of / open and it was fixed. Now the add-on stops shortly after navigating away from VS Code. I think some crawling/indexing process in VS Code is responsible for taking up resources and keeping the add-on from stopping.
So, limit your workspace to just /config and you should be fine (unless there’s a huge number of files in your /config folder)
Thxs for providing that fix. I added the following to the Visual Studio config file:
config_path: /root/config
So far this seems to work!
Kevin
Great catch there @Omnipius, I tried starting it again, but this time limiting it to /config, and that has kept it in check for a week.
Though it’s a workaround for that problem, now it is getting annoying that the developers decided to move the configs for the addons out of the config folder
Write up the issue against the extension as that’s what’s causing the slow down.
Discovered if you select as working folder root, then vscode start searching for all system directories, using constantly 30% cpu and cause reboot of system. Detect this behavior on hassio with rpi4. If I select as working folder homeassistant directory then is cpu consumption under 1%.
I can confirm that it’s working for me too.
Maybe it will be usefull for someone.
In my case adding /config path didn’t change anything. Still high cpu was the problem.
For me helps deleting strange symlink in config folder named ‘homeassistant’ causing inifnity loop to config path.