Open ScottG489 opened 1 year ago
Same problem here.
Same problem here.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Just updated my Home Assistant addons and started experiencing issues with my home "lagging". After investigating the issue, I noticed that the Visual Studio addon consumed 95% CPU and 57% ram. Turning the addon off lowered the overall resource usage on my Home Assistant system. See attached pictures.
Still an issue.
I've also seen a memory leak...
I noticed that it started happening after I opened folder /
, because I was going back and forth between editing a local addon and HA config. After switching back to /config
and restarting vscode, I haven't seen the problem again.
I specifically started configuring the Terminal & SSH addon to be able to use VSCode Remote - SSH specifically because of this memory issue.
My theory is that with each loading of the VSCode web interface, it's spinning up a new process without killing the old one. I say this because judging by the memory footprint over time, I can see stark stepwise jumps of memory use.
@BNolet I've seen similar spike patterns as well and had also theorized that. I wonder if something changed recently with how new instances are being spun up.
I'm also considering using an external client, though I'll be using intellij instead. I've already got it working via sshfs.
Have any of you guys been experiencing random reboots because of this maybe? My HA install has been rebooting pretty frequently and couldn't find a culprit. I've started disabling add-ons and after I noticed (see #589 as well) VSS uses port 1337 which shows up a lot in the logs.
@VNRARA I've had to manually reboot my system because I ran out of memory, and soon after swap. Once everything starts swapping to disk the system essentially locks up.
I'd suggest enabling resource usage sensors for your add-ons. I've found it very valuable since I've done so. You can do this by going to the services created for each add-on and enabling the CPU and memory percent sensors.
I think both Node-Red and VSCode might be culprits here. (I'm on a 4GB system)
VS code is already using: +100mb RAM from boot and Node-Red +115MB.
This also sometimes happens:
[02:28:34] [172.30.32.2][c05a3361][ManagementConnection] Unknown reconnection token (never seen). [02:28:34] [172.30.32.2][e68f3661][ExtensionHostConnection] Unknown reconnection token (never seen). [02:34:01] [172.30.32.2][e9f8b661][ManagementConnection] New connection established. [02:34:03] [172.30.32.2][aa78680f][ExtensionHostConnection] New connection established. [02:34:03] [172.30.32.2][aa78680f][ExtensionHostConnection] <468> Launched Extension Host Process.
I think a few hundred MB for either of those is more than acceptable.
Bringing this discussion back on topic though, I'd pay attention to sustained increases to the memory usage of VS Code as an indicator that you're also seeing a memory leak.
I have the same issue on my home assistant blue, after I disabled VSCode and didn’t use it anymore I didn’t have any reboots. When I used it heavily it crashed every half an hour.
Mine did crash so it may also be node-red
@Xlinx64 Wow that's pretty bad if it happens so quickly. I'd double check the system requirements in the docs for this add-on to make sure your system meets them.
Also, here's an automation I created as a fallback to restart the add-on if it uses up too much memory. Be sure to change the value based on your system's resources:
trigger:
- platform: numeric_state
entity_id: sensor.studio_code_server_memory_percent
above: 20
action:
- service: hassio.addon_restart
data:
addon: a0d7b954_vscode
@ScottG489 Thank you for the script! But I dont dare to use the add-on until it is fixed. I use the File Editor add-on for now. I have to admit that on the day with the crashes I opened and closed it a lot since I did some template sensors.
You can also use VSCode Remote - SSH with the SSH & Terminal add-on if you're looking for a longer term solution: https://community.home-assistant.io/t/vs-code-remote/129887/24?u=brandonnolet
Yea, I have the same issue on 16gb machine.. Takes about 1-2 weeks before I run out of memory :( Could be related to https://github.com/coder/code-server/issues/5201, but that is super vague.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still an issue.
I am having the same issue, I posted some more information in this ticket: https://github.com/coder/code-server/issues/6213
the same problem, until the complete loss of memory
Same issue here. I keep VSCode off, and only switch it one when needed. Today I forgot to switch it off again and had to hard-reboot my Pi.
If you'd like to help manage this for now, you can create an automation to restart the VSCode add-on if it uses up too much memory. Something like this (adjust the above
number for your situation):
trigger:
- platform: numeric_state
entity_id: sensor.studio_code_server_memory_percent
above: 20
action:
- service: hassio.addon_restart
data:
addon: a0d7b954_vscode
Note that you'll need to enable the memory entity for this add-on in the supervisor integration.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still an issue.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still an issue.
I belive i have the same issue. Although i experience this problem longer then the creator of this issue. Haven't really payed attention to memory usage because i have quite a lot, but the cpu usage goes high like crazy. I noticed that after i only open vscode, i don't even have to open config.yml or some other file, and then go to a different page inside home assistant, after a while the fans of my home assistant nuc spin up like crazy. This never happens, only with this problem. On the addon page i see cpu values sometimes as low as 25% and sometimes as high as 75%. When i restart the addon everything becomes normal again. Cpu load and fan drops.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still an issue.
Same here sadly
Same here. Please have a look at this
Same here
FYI it's better form (this goes for anywhere you come across an issue on GitHub) to add a thumbs up to the original comment rather than posting a "me too" comment unless you have more info to add :+1:
FYI it's better form (this goes for anywhere you come across an issue on GitHub) to add a thumbs up to the original comment rather than posting a "me too" comment unless you have more info to add 👍
At least i know. I'm just preventing this issue to be closed due to inactivity ;-) And i guess the others are doing it for the same reason.
I've noticed also that if I use VSC installed in windows and access HA from there, the CPU and memory load rises again, so maybe its not the addon but the file access ? Currently having the addon stopped and using external, at least I remember to close that rather than stop the addon
Just wanted to pop in here and confirm that I am to getting massive memory leaks from this.
Just fired up my little nuc, 16gb ddr4 & 8 cores,
Absolutely ate all of that ram-up and about 93% of the CPU.
I'm running HAOS
Disabling the add-on significantly sped up everything within HA, it wasn't until I downloaded glance, did I notice how much it was eating.
I have the same issue. Once I start VSC addon it will spike the CPU and then settle down once it gets all loaded. As soon as I go into VSC, with nothing more than the Welcome, no files open, and only the /config folder showing my CPU usage will go crazy, memory will keep climbing, do a small dump, climb higher than before dump, repeating this cycle as the memory usage increases. My Pi will shutdown from heat due to CPU usage going for 100-200%+ before the memory fills up. I have uninstalled and reinstalled. Just started in the past 2 weeks or so. So for now, I have it disabled and can't even start it.
https://github.com/hassio-addons/addon-vscode/issues/761
Doesnt seem to have the full attention...
Sadly, it seems like 0 attention as it is nearing a year old issue since reported. Funny though, as my issue only started within the last few weeks.
As with the suggestion in your issue thread, to disable when not using iznt viable for me. As when I start the VSC addon, it starts heating up the chipset on my pi until it shuts down/crashes (not sure which exactly) and I have to unplug my pi to reset it.
I'm currently looking for alternatives so I can work on my yaml's while away from my lan. I could just login to my VPN and sudo nano, but like the error checking to help double check my spacing and such.
Same here. Noticing an unusually high CPU usage on a near idle system, and it was VS Code using way too many resources:
You can clearly spot the moment I turned off the addon.
Ok, so I think I figured out the cause, not sure if it is the addon or the specific extension that is causing it though.
First let me start off, I'm a Linux noob, I started maybe 6 months ago for my aquarium automation build, so if I say something dumb, please bare with me lol,
What I found out by using the 'top' command was 'node' was using a lot of CPU. Also, if I would leave the VSC instance, and go back, it would add another 'node' process. I tested this 3 times to verify, and each time it added another 'node' and would stack the CPU and Mem usage.
I used 'ps -Flww -p' with the PID at the end and it would show me a folder path to the .js file. I'm guessing this is the file that is being ran with node. Part of the path had the authors name, which allowed me to look at all the plugins that were enabled.
I looked through all the enabled extensions in VSC and came across...
Once I disabled and restarted VSC the issues when away. The CPU usage would go back to 0% for the Addon once I left the VSC screen. I reenabled this plugin again, restarted VSC and problem started again. So, disabled and now it works without issue, except the color formatting is gone and all the other features like autocomplete of entities. I also noticed that in extension marketplace it shows the version as 1.39, where as on the extensions GitHub it shows 1.40 being released last month. Granted nothing in the changelog that would hint the issue would be fixed though.
Again, I'm Linux dumb, so forgive me, but I'm guessing that means the Node command that is left running when you leave/disconnect from the VSC instance is not being shutdown and is running as a zombie. Hopefully there is a fix for this soon. I like VSC so much better than File Editor as I need all the help I can get with syntax errors.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still an issue for me
Still an issue here as well!
I am also having this problem in the last couple of weeks ! Cannot use vscode more than a couple minutes before it starts to misbehave and hang Haos. I dont know if this is related but node red wont start too and i had to delete it and reinstall. Running in a vm with 6gb ram and 2 cores x 2 threads (i9 9th gen)
Ok, so I think I figured out the cause, not sure if it is the addon or the specific extension that is causing it though.
First let me start off, I'm a Linux noob, I started maybe 6 months ago for my aquarium automation build, so if I say something dumb, please bare with me lol,
What I found out by using the 'top' command was 'node' was using a lot of CPU. Also, if I would leave the VSC instance, and go back, it would add another 'node' process. I tested this 3 times to verify, and each time it added another 'node' and would stack the CPU and Mem usage.
I used 'ps -Flww -p' with the PID at the end and it would show me a folder path to the .js file. I'm guessing this is the file that is being ran with node. Part of the path had the authors name, which allowed me to look at all the plugins that were enabled.
I looked through all the enabled extensions in VSC and came across...
Once I disabled and restarted VSC the issues when away. The CPU usage would go back to 0% for the Addon once I left the VSC screen. I reenabled this plugin again, restarted VSC and problem started again. So, disabled and now it works without issue, except the color formatting is gone and all the other features like autocomplete of entities. I also noticed that in extension marketplace it shows the version as 1.39, where as on the extensions GitHub it shows 1.40 being released last month. Granted nothing in the changelog that would hint the issue would be fixed though.
Again, I'm Linux dumb, so forgive me, but I'm guessing that means the Node command that is left running when you leave/disconnect from the VSC instance is not being shutdown and is running as a zombie. Hopefully there is a fix for this soon. I like VSC so much better than File Editor as I need all the help I can get with syntax errors.
Definity solved the RAM and CPU Issue ...
It may be more related to this issue here: https://github.com/keesschollaart81/vscode-home-assistant/issues/2656
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Problem/Motivation
This addon increases in memory consumption until my system runs out.
I've been monitoring it since my last incident and I had to restart the host. The host has a total of 4GB of memory which meets the documented requirements.
Though I've only been tracking memory per-addon for the duration of the first graph, I have been running this addon for over a year and I've only been having memory usage issues recently:
I usually update addons pretty quickly after there's a release, and I can see v5.4.1 was released right around that time. Though from the release notes nothing sticks out.
I'm on the latest version and default config.
Expected behavior
For the memory usage of this addon to not increase indefinitely.
Actual behavior
Memory appears to increase indefinitely. Last time my system used up all memory and swap and locked up due to swap disk usage and I had to restart.
Steps to reproduce
As far as I can tell I'm using VS Code normally. I've only installed one extension (vim).
Unfortunately, I don't have any more information than above, but I'm happy to troubleshoot and get more information if you have suggestions on how to do so. I connected to the container and it doesn't have
ps
or evenfree
so it seems like my tooling in the container is limited.Thoughts on what this could be?