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

Memory leak on JS Z-wave 0.5.0 #3575

Closed
mldkfa opened this issue Apr 22, 2024 · 6 comments
Closed

Memory leak on JS Z-wave 0.5.0 #3575

mldkfa opened this issue Apr 22, 2024 · 6 comments
Labels

Comments

@mldkfa
Copy link

mldkfa commented Apr 22, 2024

Describe the issue you are experiencing

I updated to JS Z-wave .50 yesterday and my HomeAssistant ended up with a memory leak. When logged into the CLI, I would get errors with "Out of Memory" and my z-wave network would be unresponsive. I would login to HomeAssistant and the Z-wave JS server would be running, but the Z-wave integration would be stopped and unable to be restarted without restarting the whole server.

I increased the available memory to the VM up to 8gb (from 4gb) and still ran out of memory by the next morning. I then downloaded the most recent VM, uploaded a recent backup taken before Z-wave 0.5.0. It ran fine until I upgraded this afternoon back to 0.5.0 and again the server started throwing memory errors. I restored to pre Z-wave 0.5.0 and have had no issues since. I'm currently sitting at 1GB of memory utilized.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Z-Wave JS

What is the version of the add-on?

0.5.0

Steps to reproduce the issue

  1. upgrade from Z-Wave JS 0.4.3 to 0.5.0
    2.Wait an hour and have the system crash.

...

System Health information

System Information

version core-2024.4.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.25-haos
arch x86_64
timezone America/New_York
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4954
Installed Version 1.30.1
Stage running
Available Repositories 1400
Downloaded Repositories 6
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.2
update_channel stable
supervisor_version supervisor-2024.04.0
agent_version 1.6.0
docker_version 25.0.5
disk_total 30.8 GB
disk_used 6.6 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Z-Wave JS (0.4.3), File editor (5.8.0), Check Home Assistant configuration (3.11.0), AirCast (4.2.1), Log Viewer (0.17.0), Advanced SSH & Web Terminal (17.2.0), Samba share (12.3.1), motionEye (0.17.0), Terminal & SSH (9.13.0), Mosquitto broker (6.4.0), TasmoAdmin (0.30.0)
Dashboards
dashboards 3
resources 0
views 2
mode storage
Recorder
oldest_recorder_run February 1, 2024 at 9:23 PM
current_recorder_run April 21, 2024 at 8:09 PM
estimated_db_size 126.57 MiB
database_engine sqlite
database_version 3.44.2

Anything in the Supervisor logs that might be useful for us?

n/a

Anything in the add-on logs that might be useful for us?

n/a

Additional information

No response

@AlCalzone
Copy link
Contributor

Any chance you can test 0.4.5? This is likely caused by a dependency update, and I'm trying to figure out which one.

@AlCalzone
Copy link
Contributor

AlCalzone commented Apr 22, 2024

FWIW, I tried to reproduce this with Z-Wave JS UI (addon 3.5.0, driver version 12.5.5) by sending 10000 commands to a 3-channel relay which responds with 4 commands each (response plus updates for 3 channels), totaling 40000 incoming commands, about once every 100ms plus delay.

Memory usage slightly increased during that process:
grafik
and then went back to normal after the traffic was gone:
grafik

I couldn't reproduce with just node-zwave-js alone either, so this might be something related to your Z-Wave installation or the Z-Wave JS addon.


Reading the report again

Z-wave JS server would be running, but the Z-wave integration would be stopped

...does this mean the integration would run OOM, but the addon was fine? If so, any chance you could collect some RAM usage numbers of the integration and the addon over time?

@mldkfa
Copy link
Author

mldkfa commented Apr 23, 2024

does this mean the integration would run OOM, but the addon was fine? If so, any chance you could collect some RAM usage numbers of the integration and the addon over time?

I believe so. What data do you need and how do I gather it for you?

@AlCalzone
Copy link
Contributor

I was told that individual integration RAM usage cannot be measured.
Having a history graph of the addon RAM usage (and possibly the HA core RAM usage) could be helpful. But honestly, I don't know how to do that - I use HA too little for that.

@kpine
Copy link
Contributor

kpine commented Apr 24, 2024

HA has a built-in profiler, you could try that. https://www.home-assistant.io/integrations/profiler/

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 24, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants