Memory overload on openHAB 2.5.4 - 1

Tags: #<Tag:0x00007f616f3b1c30> #<Tag:0x00007f616f3b1b18> #<Tag:0x00007f616f3b1910>

Did you attempt my proposals?
Things to try other than those:

  • move to snapshot
  • identify the component to probably cause the memleak by deactivating some of the bindings

Do you have the miio binding enabled?

@Simsal, yes I do!

@mstormi I didn’t enable ZRAM because all the warnings from openhabian-config, but I’ll do it right away.

the swapon shows that /var/swap file size is 100M used 0.

  • I listed the processes (ps -ef) but I didn’t find informations about java:

    UID        PID  PPID  C STIME TTY          TIME CMD
    root         1     0  0 06:19 ?        00:00:06 /sbin/init
    root         2     0  0 06:19 ?        00:00:00 [kthreadd]
    root         3     2  0 06:19 ?        00:00:00 [rcu_gp]
    root         4     2  0 06:19 ?        00:00:00 [rcu_par_gp]
    root         8     2  0 06:19 ?        00:00:00 [mm_percpu_wq]
    root         9     2  0 06:19 ?        00:00:02 [ksoftirqd/0]
    root        10     2  0 06:19 ?        00:00:16 [rcu_sched]
    root        11     2  0 06:19 ?        00:00:00 [rcu_bh]
    root        12     2  0 06:19 ?        00:00:00 [migration/0]
    root        13     2  0 06:19 ?        00:00:00 [cpuhp/0]
    root        14     2  0 06:19 ?        00:00:00 [cpuhp/1]
    root        15     2  0 06:19 ?        00:00:00 [migration/1]
    root        16     2  0 06:19 ?        00:00:00 [ksoftirqd/1]
    root        19     2  0 06:19 ?        00:00:00 [cpuhp/2]
    root        20     2  0 06:19 ?        00:00:00 [migration/2]
    root        21     2  0 06:19 ?        00:00:00 [ksoftirqd/2]
    root        24     2  0 06:19 ?        00:00:00 [cpuhp/3]
    root        25     2  0 06:19 ?        00:00:00 [migration/3]
    root        26     2  0 06:19 ?        00:00:01 [ksoftirqd/3]
    root        29     2  0 06:19 ?        00:00:00 [kdevtmpfs]
    root        30     2  0 06:19 ?        00:00:00 [netns]
    root        32     2  0 06:19 ?        00:00:03 [kworker/1:1-events]
    root        34     2  0 06:19 ?        00:00:00 [khungtaskd]
    root        35     2  0 06:19 ?        00:00:00 [oom_reaper]
    root        36     2  0 06:19 ?        00:00:00 [writeback]
    root        37     2  0 06:19 ?        00:00:00 [kcompactd0]
    root        38     2  0 06:19 ?        00:00:00 [crypto]
    root        39     2  0 06:19 ?        00:00:00 [kblockd]
    root        40     2  0 06:19 ?        00:00:00 [watchdogd]
    root        42     2  0 06:19 ?        00:00:00 [rpciod]
    root        43     2  0 06:19 ?        00:00:00 [kworker/u9:0-hci0]
    root        44     2  0 06:19 ?        00:00:00 [xprtiod]
    root        47     2  0 06:19 ?        00:00:00 [kswapd0]
    root        48     2  0 06:19 ?        00:00:00 [nfsiod]
    root        59     2  0 06:19 ?        00:00:00 [kthrotld]
    root        60     2  0 06:19 ?        00:00:00 [iscsi_eh]
    root        61     2  0 06:19 ?        00:00:00 [dwc_otg]
    root        62     2  0 06:19 ?        00:00:00 [DWC Notificatio]
    root        63     2  0 06:19 ?        00:00:00 [vchiq-slot/0]
    root        64     2  0 06:19 ?        00:00:00 [vchiq-recy/0]
    root        65     2  0 06:19 ?        00:00:00 [vchiq-sync/0]
    root        66     2  0 06:19 ?        00:00:00 [vchiq-keep/0]
    root        68     2  0 06:19 ?        00:00:00 [irq/86-mmc1]
    root        71     2  0 06:19 ?        00:00:00 [mmc_complete]
    root        75     2  0 06:19 ?        00:00:01 [jbd2/mmcblk0p2-]
    root        76     2  0 06:19 ?        00:00:00 [ext4-rsv-conver]
    root        77     2  0 06:19 ?        00:00:00 [kworker/1:2H-kblockd]
    root        78     2  0 06:19 ?        00:00:01 [kworker/2:1H-kblockd]
    root        80     2  0 06:19 ?        00:00:00 [ipv6_addrconf]
    root        96     2  0 06:19 ?        00:00:00 [kworker/3:2H-kblockd]
    root        97     2  0 06:19 ?        00:00:01 [kworker/0:2H+kblockd]
    root       102     1  0 06:19 ?        00:00:01 /lib/systemd/systemd-journald
    root       146     1  0 06:19 ?        00:00:01 /lib/systemd/systemd-udevd
    root       209     2  0 06:19 ?        00:00:00 [cfg80211]
    root       211     2  0 06:19 ?        00:00:00 [brcmf_wq/mmc1:0]
    root       213     2  0 06:19 ?        00:00:00 [brcmf_wdog/mmc1]
    systemd+   252     1  0 06:19 ?        00:00:00 /lib/systemd/systemd-timesyncd
    root       295     1  0 06:19 ?        00:00:00 /lib/systemd/systemd-logind
    message+   296     1  0 06:19 ?        00:00:00 /usr/bin/dbus-daemon --system --      address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
    root       297     1  0 06:19 ?        00:00:00 /usr/sbin/alsactl -E HOME=/run/alsa -s -n 19 -c rdaemon
    avahi      298     1  0 06:19 ?        00:00:07 avahi-daemon: running [openhabian.local]
    root       304     1  0 06:19 ?        00:00:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
    root       309     1  0 06:19 ?        00:00:00 /usr/sbin/cron -f
    root       314     1  0 06:19 ?        00:00:09 /usr/sbin/rngd -r /dev/hwrng
    avahi      315   298  0 06:19 ?        00:00:00 avahi-daemon: chroot helper
    root       323     1  0 06:19 ?        00:00:00 /usr/sbin/rsyslogd -n -iNONE
    root       386     1  0 06:19 ?        00:00:00 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext
    root       407     1  0 06:20 ?        00:00:00 /usr/bin/hciattach /dev/serial1 bcm43xx 921600 noflow - b8:27:eb:81:e2:a7
    root       411     2  0 06:20 ?        00:00:00 [kworker/u9:2-hci0]
    root       412     1  0 06:20 ?        00:00:00 /usr/lib/bluetooth/bluetoothd
    root       482     1  0 06:20 ?        00:00:06 /sbin/dhcpcd -q -w
    root       485     1  0 06:20 ?        00:00:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
    openhab    486     1 27 06:20 ?        02:23:30 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runt
    openhab    487     1  0 06:20 ?        00:00:11 node /usr/lib/node_modules/frontail/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/pre
    root       488     1  0 06:20 ?        00:00:09 /usr/sbin/nmbd --foreground --no-process-group
    mosquit+   489     1  0 06:20 ?        00:00:28 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
    root       497     1  0 06:20 tty1     00:00:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
    root       535     1  0 06:20 ?        00:00:00 /usr/sbin/sshd -D
    root       628     1  0 06:20 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group
    root       654   628  0 06:20 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group
    root       655   628  0 06:20 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group
    root       660   628  0 06:20 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group
    openhab    724   487  0 06:20 ?        00:00:00 tail -n 200 -F /var/log/openhab2/openhab.log /var/log/openhab2/events.log
    root       824     2  0 13:58 ?        00:00:00 [kworker/0:1H]
    root      1332     2  0 14:05 ?        00:00:00 [kworker/1:1H]
    root      1400     2  0 14:06 ?        00:00:00 [kworker/u8:1-events_unbound]
    root      1803     2  0 14:12 ?        00:00:00 [kworker/2:0-mm_percpu_wq]
    root      1818     2  0 14:12 ?        00:00:00 [kworker/1:2-cgroup_destroy]
    root      1983     2  0 14:14 ?        00:00:01 [kworker/0:0-events]
    root      2416     2  0 14:21 ?        00:00:00 [kworker/3:1H]
    root      3177     2  0 14:33 ?        00:00:00 [kworker/0:2-events_power_efficient]
    root      4554     2  0 14:54 ?        00:00:00 [kworker/3:0-mm_percpu_wq]
    root      4615     2  0 14:55 ?        00:00:00 [kworker/2:0H]
    root      4927     2  0 14:59 ?        00:00:00 [kworker/3:1-mm_percpu_wq]
    root      5235     2  0 15:05 ?        00:00:00 [kworker/u8:0]
    root      5273     2  0 15:05 ?        00:00:00 [kworker/2:2H]
    root      5277   535  1 15:05 ?        00:00:00 sshd: openhabian [priv]
    root      5300     2  0 15:05 ?        00:00:00 [kworker/3:2-events]
    root      5308     2  0 15:05 ?        00:00:00 [kworker/2:2-rcu_gp]
    openhab+  5309     1  2 15:05 ?        00:00:00 /lib/systemd/systemd --user
    openhab+  5312  5309  0 15:05 ?        00:00:00 (sd-pam)
    openhab+  5326  5277  0 15:05 ?        00:00:00 sshd: openhabian@pts/0
    openhab+  5329  5326  3 15:05 pts/0    00:00:00 -bash
    root      5727     2  0 15:05 ?        00:00:00 [kworker/0:1]
    root      5730     2  0 15:05 ?        00:00:00 [kworker/0:0H]
    openhab+  5731  5329  0 15:05 pts/0    00:00:00 ps -ef
    root     12855     1  0 09:09 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug
    root     15152     2  0 09:24 ?        00:00:01 [kworker/2:1-rcu_gp]
    root     32684     2  0 13:51 ?        00:00:00 [kworker/u8:2-events_unbound]
    

I’ll post the results as soon as get any updates.

Thanks in advance!

Paulo

Duh, so you’ve got 1.1G in total… that’s not enough. Increase swap if you can (you can add another swapfile). But ZRAM is even better.

1 Like

Please read Marcel’s recommendations.
Another user tracked it to the new miio cloud connection and faulty configuration.

2 Likes

@mstormi just enabled ZRAM, I’ll be monitoring the RPI for the next hours to see if there will be any problem… if it doesn’t work, I’ll try to increase swap…

Well if your system outgrows your virtual mem you have a memleak. With more swap and ZRAM you’ll hit the limit later but you still will hit it, so go find the component that causes it.

1 Like

I fixed a thread leaking in the miio binding this week. So please try a setup without the miio binding.
The fix will be in next version 2.5.5.

3 Likes

I think that more of less 30% of the lights at home uses this binding. However after I installed zram as @mstormi suggested, so far I didn’t have any problems… Before I had to reboot every 9 hours and now it is running for about 30 hours. But in order to give a final word I’ll see if there’s something happening within the next days… I’ll keep you posted…

Is this thread leaking available in openhab 2.5.0 (stable) ?

1 Like

As I said, I fixed this issue this week, so of course it is not included in 2.5.0. It will be included in next version, 2.5.5.

1 Like

My mistake… What I meant was…
Is the issue with the thead leaking in the 2.5.0 ?

1 Like

It is probably since a long time, maybe since the first day ? Sorry, I don’t know exactly.

1 Like

Okay… Will the jar be available?

I heard 2.5.5 will likely get released soon.

1 Like

For the 2.5.5 snapshot : https://ci.openhab.org/job/openHAB2.5.x-Addons/ws/bundles/org.openhab.binding.miio/target/org.openhab.binding.miio-2.5.5-SNAPSHOT.jar

2 Likes

@mstormi after 8 more hours the system stalled because of the memory full. You were right because of zram, openhab could stay longer but at the end I had to reboot the rpi…

Just upgraded to 2.5.5, I’ll monitor the performance of the RPI. I hope this upgrade will solve the thread issue!!

Best regards,

Paulo

After 8 days running with no flaws, just wanted to report that the 2.5.5 version solved the thread problem!

Thanks everyone for the support!

Paulo

5 Likes