OH1: Java -> too many file descriptors

I have noticed that my OH1 needs a reboot every 70-ish days…
Looking into this issue revealed that Java has 40,000 files open…

sudo lsof | cut -d " " -f 1 | uniq -c | sort -nr
  40041 java
    415 apache2
...

Looking up the Java PID and listing the files with:

sudo ls -l /proc/9466/fd

shows tons of openHAB files.

How can I fix his?
Can I fix it? As in, is it an openAB problem?
What other info is needed to look into this?

Reboot the device. That will fix the problem. It might come back again, though.
As to whether it’s an OH problem, is harder to say.
You should make a list of the bundles that were running during the time period in question. It’s possible one (or more) of them is leaking.

Yes, reboot will fix it, but is a band aid rather than a solution. :slight_smile:

And it does come back…

I am interested in a fix; e.g. a proper way to get to the bottom of this, so that I can log an issue with whomever I need to…

Any hints appreciated…

Today’s stats look like this:

sudo lsof | awk '{ print $2 " " $1; }' | sort -rn | uniq -c | sort -rn | head -20
  41269 9466 java
    380 669 llvmpipe-
...

Again, we need to know which bundles/bindings were running.

Also, it would be interesting to compare the numbers above with these scenarios:

  • OH not running
  • OH running with no bindings installed

Hmmm…
This is from a fresh install of openHABian… not config done to it, nothing installed (other than lsof)
I selected EXPERT mode, hence, no bindings are installed as I understand it.

[12:35:40] root@openHABianPi:/home/openhabian# sudo lsof | awk '{ print $2 " " $1; }' | sort -rn | uniq -c | sort -rn | head -20
  36618 31302 java
    193 7012 smbd
    188 29706 smbd
    182 29712 smbd
    156 30780 node
    104 30780 V8
     55 31470 sshd
     51 31461 sshd
     45 1 systemd
     39 132 systemd-j
     38 420 dbus-daem
     37 417 avahi-dae
     36 5486 systemd-u
     34 477 wpa_suppl
     33 844 sshd
     33 539 bluetooth
     33 10039 rpcbind
     32 31954 su
     31 31950 sudo
     31 1058 sudo
[12:35:50] root@openHABianPi:/home/openhabian# uptime
 12:38:30 up 7 days,  4:18,  1 user,  load average: 0.11, 0.30, 0.18