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 increases until kernel crash #43

Open
joerg65 opened this issue Feb 2, 2020 · 3 comments
Open

Memory increases until kernel crash #43

joerg65 opened this issue Feb 2, 2020 · 3 comments
Labels
ready-for-qa Ready for testing by original reporter

Comments

@joerg65
Copy link

joerg65 commented Feb 2, 2020

I'm running local copy of Almond-Server on a Asus Tinker Board with Armbian OS.
After starting the server reserves about 56M, then I see that the memory increases step by step over 1 - 2 days until the system runs out of memory.

  2  [|||                                                                                2.2%]   Tasks: 49, 56 thr; 1 running
  3  [||||                                                                               4.0%]   Load average: 0.12 0.40 0.54 
  4  [||||||                                                                             5.2%]   Uptime: 03:37:47
  Mem[|||||||||||||||||||||||||||||||||||||||||||||                                598M/1.95G]   CpuFreq1: 1.61 GHz
  Swp[                                                                               0K/1001M]   CpuFreq2: 1.61 GHz
  Cpu Temp:   56 C                                                                               CpuFreq3: 1.61 GHz
                                                                                                 CpuFreq4: 1.61 GHz
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 1313 joerg      20   0  9884  5500  4472 S  0.0  0.3  0:02.06 ├─ /lib/systemd/systemd --user
 2907 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:35.68 │  ├─ /usr/bin/node /srv/almond-server/main.js
 2918 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.13 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2917 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.14 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2916 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.14 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2915 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.14 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2913 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.00 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2912 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:02.46 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2911 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:02.31 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2910 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:02.60 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2909 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:02.34 │  │  ├─ /usr/bin/node /srv/almond-server/main.js
 2908 joerg      20   0  750M  390M 28656 S  0.0 19.5  0:00.00 │  │  └─ /usr/bin/node /srv/almond-server/main.js```


I wonder if this is related to the `Unhandled Home Assistant entity...`
I have a lot of unsupported sensors sending state every now and then.
@gcampax
Copy link
Contributor

gcampax commented Feb 3, 2021

HI thanks for you report, and sorry for the delay.

I think the issue you're seeing has to do with the garbage collection. By default, node's GC assumes that 1G of memory is available for the JS heap. You can lower the amount of memory by running node --max_old_space_size=200 main.js.
(size is in megabytes).
In recent experiments with the latest version of Almond, we found that on a 64 bit OS it runs at around 150-180M usage (it is quite more memory hungry than previous versions). If you can, I would set it to 200 or 250 to be sure.

@nrser
Copy link

nrser commented Aug 4, 2021

@joerg65 are you still able to reproduce this?

@nrser nrser added the ready-for-qa Ready for testing by original reporter label Aug 4, 2021
@niemyjski
Copy link

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-qa Ready for testing by original reporter
Projects
None yet
Development

No branches or pull requests

4 participants