openHAB 3 freeze

Hello all,

I have openHAB 3 running on a Raspberry Pi 4.

  • Release = Raspbian GNU/Linux 10 (buster)
  • Kernel = Linux 5.10.103-v7l+
  • Platform = Raspberry Pi 4 Model B Rev 1.4
  • CPU Usage = 2.76% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
  • CPU Load = 1m: 0.21, 5m: 0.18, 15m: 0.11
  • Memory = Free: 6.80GB (88%), Used: 0.95GB (12%), Total: 7.76GB
  • Root = Free: 49.59GB (87%), Used: 6.80GB (13%), Total: 58.26GB
  • openjdk version “11.0.13” 2021-10-19 LTS
  • OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
  • OpenJDK Client VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)

Again and again the system stops, sometimes after a few days, sometimes after 1 - 2 weeks. I can’t see a pattern. Then I turn the RPi off and on again and everything runs again.

Now I had such a case again. SSH to the RPi is running. So only openHAB hangs.
In openhab.log is nothing at all to a problem or a cause. Via PC or smartphone I can open the UI interface but changes to items or things are not executed, no items or things are updated.

I have recorded the following with htop


  1  [                                                                                           0.0%]   Tasks: 34, 236 thr; 1 running
  2  [                                                                                           0.0%]   Load average: 0.00 0.02 0.01
  3  [|||                                                                                        2.6%]   Uptime: 2 days, 10:50:05
  4  [                                                                                           0.0%]
  Mem[||||||||||||||                                                                       453M/7.76G]
  Swp[                                                                                       0K/2.00G]

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 7576 root       20   0  9820  4076  2252 R  2.6  0.1  0:00.87 htop
  667 openhab    20   0  625M  374M 10140 S  0.0  4.7  1h30:37 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
20963 openhab    20   0  625M  374M 10140 S  0.0  4.7  1:02.06 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1659 openhab    20   0  625M  374M 10140 S  0.0  4.7  3:02.71 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 7551 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:00.08 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1496 openhab    20   0  625M  374M 10140 S  0.0  4.7  4:32.67 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1481 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:37.82 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1485 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:38.80 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 7083 openhabia  20   0 12240  3636  2848 S  0.0  0.0  0:00.03 sshd: openhabian@pts/0
 1624 openhab    20   0  625M  374M 10140 S  0.0  4.7  2:07.45 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1658 openhab    20   0  625M  374M 10140 S  0.0  4.7  3:08.70 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1498 openhab    20   0  625M  374M 10140 S  0.0  4.7  4:31.68 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1544 openhab    20   0  625M  374M 10140 S  0.0  4.7  4:39.06 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
  806 openhab    20   0  625M  374M 10140 S  0.0  4.7  6:57.96 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1552 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:23.65 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
  926 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:24.34 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1556 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:22.79 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1559 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:24.27 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1233 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:11.58 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 2347 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:01.83 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
 1488 openhab    20   0  625M  374M 10140 S  0.0  4.7  0:48.39 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.
    1 root       20   0 33828  8168  6456 S  0.0  0.1  0:37.58 /sbin/init
  122 root       20   0 62280 10768  9876 S  0.0  0.1  0:09.61 /lib/systemd/systemd-journald
  159 root       20   0 18156  3920  3108 S  0.0  0.0  0:00.94 /lib/systemd/systemd-udevd
  342 messagebu  20   0  6648  3512  3012 S  0.0  0.0  0:08.20 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
  349 root       39  19  3692   720   612 S  0.0  0.0  0:00.10 /usr/sbin/alsactl -E HOME=/run/alsa -s -n 19 -c rdaemon
  353 root       20   0  8312  2292  2080 S  0.0  0.0  0:00.98 /usr/sbin/cron -f
  360 root       20   0 13136  5760  5076 S  0.0  0.1  0:03.29 /lib/systemd/systemd-logind
  389 root       20   0 25512  2668  2356 S  0.0  0.0  0:00.65 /usr/sbin/rsyslogd -n -iNONE
  390 root       20   0 25512  2668  2356 S  0.0  0.0  0:00.78 /usr/sbin/rsyslogd -n -iNONE
  391 root       20   0 25512  2668  2356 S  0.0  0.0  0:00.00 /usr/sbin/rsyslogd -n -iNONE
  363 root       20   0 25512  2668  2356 S  0.0  0.0  0:01.50 /usr/sbin/rsyslogd -n -iNONE
  370 root       20   0 10744  3700  3328 S  0.0  0.0  0:01.38 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
  375 avahi      20   0  5900  2632  2380 S  0.0  0.0  0:28.31 avahi-daemon: running [openhabian.local]
  393 avahi      20   0  5768   252     0 S  0.0  0.0  0:00.00 avahi-daemon: chroot helper
  398 root       20   0 27656    80     0 S  0.0  0.0  0:03.16 /usr/sbin/rngd -r /dev/hwrng
  399 root       20   0 27656    80     0 S  0.0  0.0  0:00.06 /usr/sbin/rngd -r /dev/hwrng
  400 root       20   0 27656    80     0 S  0.0  0.0  0:00.25 /usr/sbin/rngd -r /dev/hwrng

After the kill of PID 667 openHAB was running again.

How can I debug this more. I would like to know where the problem is.

Greetings Holger

You likely have a memory leak.
Selectively disable bindings to identify which one is causing it.
Search this forum for memory leak or some such term for more information.
And I’d suggest you move to openHABian. Unlike homegrown setups it’s using validated settings and it has some intelligence to kill & restart OH when mem usage is exuberant.

Sorry for the misunderstanding on the RPi runs openhabian.

###############################################################################
###############  openhabian  ##################################################
###############################################################################
##        Ip = 192.168.53.21
##   Release = Raspbian GNU/Linux 10 (buster)
##    Kernel = Linux 5.10.103-v7l+
##  Platform = Raspberry Pi 4 Model B Rev 1.4
##    Uptime = 0 day(s). 1:40:46
## CPU Usage = 2.76% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 0.21, 5m: 0.18, 15m: 0.11
##    Memory = Free: 6.80GB (88%), Used: 0.95GB (12%), Total: 7.76GB
##      Swap = Free: 1.99GB (100%), Used: 0.00GB (0%), Total: 1.99GB
##      Root = Free: 49.59GB (87%), Used: 6.80GB (13%), Total: 58.26GB
##   Updates = 0 apt updates available.
##  Sessions = 1 session(s)
## Processes = 115 running processes of 32768 maximum processes
###############################################################################

                          _   _     _     ____   _
  ___   ___   ___   ___  | | | |   / \   | __ ) (_)  ____   ___
 / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ | | / _  \ / _ \
| (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )| || (_) || | | |
 \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ |_| \__|_||_| | |
      |_|                  openHAB 3.2.0 - Release Build