Closed ghost closed 1 year ago
I have the same problem on a Pi2.
Did you already discuss this problem in the community forum? As this doesn't happen to the broad user base, I'd suspect this to be related to special setup/environment aspects or one binding. Before we can tackle the issue, you need to figure out what's the provoking factor.
I tired some more investigation. It seems actually related to the fact that I have quite some Image items in my sitemap, including ip camera jpegs from Zoneminder. The Image items seem to draw a lot of resources when refreshing every 2 seconds.
I also notice, that the Basic UI is getting slower and slower (and often gets stuck until a full reload).
Does it happen to you as well, that the Basic UI gets slower or unresponsive?
I don't use image items in my sitemap. I took a look at the open files on my raspberry pi running the latest openhab2 and saw many thousands of open files after running for a couple of days. Here is a portion of the output of the "lsof" command:
java 861 1143 openhab mem REG 179,7 170472 286338 /var/lib/openhab2/cache/org.eclipse.osgi/140/0/bundleFile
java 861 1143 openhab mem REG 179,7 3661 286440 /var/lib/openhab2/cache/org.eclipse.osgi/206/0/bundleFile
java 861 1143 openhab mem REG 179,7 827794 286421 /var/lib/openhab2/cache/org.eclipse.osgi/193/0/bundleFile
java 861 1143 openhab mem REG 179,7 2031025 286442 /var/lib/openhab2/cache/org.eclipse.osgi/208/0/bundleFile
java 861 1143 openhab mem REG 179,7 513765 404376 /var/lib/openhab2/cache/org.eclipse.osgi/212/0/.cp/lib/xstream-1.4.6.jar
java 861 1143 openhab mem REG 179,7 1420806 286399 /var/lib/openhab2/cache/org.eclipse.osgi/212/0/bundleFile
java 861 1143 openhab mem REG 179,7 238184 664840 /opt/jdk1.8.0_101/jre/lib/arm/libsunec.so
java 861 1143 openhab mem REG 179,7 37721 281460 /var/lib/openhab2/cache/org.eclipse.osgi/92/0/bundleFile
java 861 1143 openhab mem REG 179,7 626389 286437 /var/lib/openhab2/cache/org.eclipse.osgi/204/0/bundleFile
java 861 1143 openhab mem REG 179,7 29718 285342 /var/lib/openhab2/cache/org.eclipse.osgi/118/0/bundleFile
java 861 1143 openhab mem REG 179,7 95899 281424 /var/lib/openhab2/cache/org.eclipse.osgi/80/0/bundleFile
java 861 1143 openhab mem REG 179,7 28280 139362 /var/lib/openhab2/persistence/rrd4j/PowerTotal.rrd
java 861 1143 openhab mem REG 179,7 115534 275976 /var/lib/openhab2/cache/org.eclipse.osgi/22/0/bundleFile
java 861 1143 openhab mem REG 179,7 626242 537408 /var/lib/openhab2/cache/org.eclipse.osgi/204/0/.cp/lib/rrd4j-2.1.1.jar
java 861 1143 openhab mem REG 179,7 14469 284116 /var/lib/openhab2/cache/org.eclipse.osgi/108/0/bundleFile
java 861 1143 openhab mem REG 179,7 414739 537392 /var/lib/openhab2/cache/org.eclipse.osgi/203/0/.cp/lib/mapdb-1.0.7.jar
java 861 1143 openhab mem REG 179,7 127212 281410 /var/lib/openhab2/cache/org.eclipse.osgi/71/0/bundleFile
java 861 1143 openhab mem REG 179,7 494924 275964 /var/lib/openhab2/cache/org.eclipse.osgi/18/0/bundleFile
java 861 1143 openhab mem REG 179,7 225356 537383 /var/lib/openhab2/cache/org.eclipse.osgi/198/0/.cp/lib/jackson-core-2.4.1.1.jar
java 861 1143 openhab mem REG 179,7 279427 664760 /opt/jdk1.8.0_101/jre/lib/ext/sunjce_provider.jar
java 861 1143 openhab mem REG 179,7 3135413 664790 /opt/jdk1.8.0_101/jre/lib/charsets.jar
java 861 1143 openhab mem REG 179,7 29688 286416 /var/lib/openhab2/cache/org.eclipse.osgi/214/0/bundleFile
java 861 1143 openhab mem REG 179,7 208959 535596 /var/lib/openhab2/cache/org.eclipse.osgi/201/0/.cp/lib/org.eclipse.paho.client.mqttv3-1.1.0.jar
java 861 1143 openhab mem REG 179,7 32190 285353 /var/lib/openhab2/cache/org.eclipse.osgi/129/0/bundleFile
java 861 1143 openhab mem REG 179,7 51239 537379 /var/lib/openhab2/cache/org.eclipse.osgi/194/0/.cp/lib/commons-email-1.4.jar
java 861 1143 openhab mem REG 179,7 2693233 286433 /var/lib/openhab2/cache/org.eclipse.osgi/202/0/bundleFile
java 861 1143 openhab mem REG 179,7 232771 272965 /var/lib/openhab2/cache/org.eclipse.osgi/27/0/bundleFile
java 861 1143 openhab mem REG 179,7 318112 281065 /var/lib/openhab2/cache/org.eclipse.osgi/59/0/bundleFile
java 861 1143 openhab mem REG 179,7 284220 276062 /var/lib/openhab2/cache/org.eclipse.osgi/31/0/bundleFile
java 861 1143 openhab mem REG 179,7 330211 286429 /var/lib/openhab2/cache/org.eclipse.osgi/198/0/bundleFile
java 861 1143 openhab mem REG 179,7 231641 286420 /var/lib/openhab2/cache/org.eclipse.osgi/192/0/bundleFile
java 861 1143 openhab mem REG 179,7 1085083 286419 /var/lib/openhab2/cache/org.eclipse.osgi/191/0/bundleFile
java 861 1143 openhab mem REG 179,7 96555 284103 /var/lib/openhab2/cache/org.eclipse.osgi/95/0/bundleFile
java 861 1143 openhab mem REG 179,7 531571 524416 /var/lib/openhab2/cache/org.eclipse.osgi/98/0/.cp/lib/xstream-1.4.7.jar
java 861 1143 openhab mem REG 179,7 124927 286392 /var/lib/openhab2/cache/org.eclipse.osgi/184/0/bundleFile
java 861 1143 openhab mem REG 179,7 71757 286391 /var/lib/openhab2/cache/org.eclipse.osgi/183/0/bundleFile
java 861 1143 openhab mem REG 179,7 532392 286390 /var/lib/openhab2/cache/org.eclipse.osgi/182/0/bundleFile
java 861 1143 openhab mem REG 179,7 136559 286389 /var/lib/openhab2/cache/org.eclipse.osgi/181/0/bundleFile
java 861 1143 openhab mem REG 179,7 225348 286386 /var/lib/openhab2/cache/org.eclipse.osgi/179/0/bundleFile
java 861 1143 openhab mem REG 179,7 6255 286401 /var/lib/openhab2/cache/org.eclipse.osgi/190/0/bundleFile
java 861 1143 openhab mem REG 179,7 50999 281383 /var/lib/openhab2/cache/org.eclipse.osgi/107/0/bundleFile
java 861 1143 openhab mem REG 179,7 63977 286364 /var/lib/openhab2/cache/org.eclipse.osgi/164/0/bundleFile
java 861 1143 openhab mem REG 179,7 18093 284118 /var/lib/openhab2/cache/org.eclipse.osgi/144/0/bundleFile
java 861 1143 openhab mem REG 179,7 25020 285337 /var/lib/openhab2/cache/org.eclipse.osgi/115/0/bundleFile
java 861 1143 openhab mem REG 179,7 108325 281413 /var/lib/openhab2/cache/org.eclipse.osgi/72/0/bundleFile
java 861 1143 openhab mem REG 179,7 61613 537371 /var/lib/openhab2/cache/org.eclipse.osgi/200/0/.cp/lib/socket.io-client-0.8.2.jar
java 861 1143 openhab mem REG 179,7 76036 537370 /var/lib/openhab2/cache/org.eclipse.osgi/200/0/.cp/lib/okio-1.9.0.jar
java 861 1143 openhab mem REG 179,7 26091 537369 /var/lib/openhab2/cache/org.eclipse.osgi/200/0/.cp/lib/okhttp-ws-3.4.1.jar
java 861 1143 openhab mem REG 179,7 344481 535703 /var/lib/openhab2/cache/org.eclipse.osgi/200/0/.cp/lib/okhttp-3.4.1.jar
java 861 1143 openhab mem REG 179,7 625596 524422 /var/lib/openhab2/cache/org.eclipse.osgi/126/0/.cp/lib/joda-time-2.9.2.jar
java 861 1143 openhab mem REG 179,7 37699 281458 /var/lib/openhab2/cache/org.eclipse.osgi/91/0/bundleFile
java 861 1143 openhab mem REG 179,7 11888 284119 /var/lib/openhab2/cache/org.eclipse.osgi/167/0/bundleFile
java 861 1143 openhab mem REG 179,7 28035 286428 /var/lib/openhab2/cache/org.eclipse.osgi/197/0/bundleFile
java 861 1143 openhab mem REG 179,7 38596 286371 /var/lib/openhab2/cache/org.eclipse.osgi/178/0/bundleFile
java 861 1143 openhab mem REG 179,7 105925 535600 /var/lib/openhab2/cache/org.eclipse.osgi/200/0/.cp/lib/engine.io-client-0.8.2.jar
java 861 1143 openhab mem REG 179,7 69964 285331 /var/lib/openhab2/cache/org.eclipse.osgi/109/0/bundleFile
java 861 1143 openhab mem REG 179,7 477486 286439 /var/lib/openhab2/cache/org.eclipse.osgi/205/0/bundleFile
java 861 1143 openhab mem REG 179,7 39771 664755 /opt/jdk1.8.0_101/jre/lib/ext/sunec.jar
java 861 1143 openhab mem REG 179,7 250826 664756 /opt/jdk1.8.0_101/jre/lib/ext/sunpkcs11.jar
java 861 1143 openhab mem REG 179,7 2683 286365 /var/lib/openhab2/cache/org.eclipse.osgi/165/0/bundleFile
java 861 1143 openhab mem REG 179,7 18098 286355 /var/lib/openhab2/cache/org.eclipse.osgi/155/0/bundleFile
j
did you try to raise the limit on java user?
Edit as root /etc/security/limits.conf
Add the new limit of files (nofiles) to the java user:
#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
java hard nofiles 65536
Reboot rasp.
To confirm:
sudo -u java ulimit -a
It must show the new limit...
[03:14:43] Kanashii@kokoro:/etc/security$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7695
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536 <--------------------- This one
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7695
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Probably you have to many items, images, calls or crons that increase too much the cache files... I'm guessing though. Maybe 65536 files are enough to avoid the file blocking.
I have increased the nofiles limit and haven't had my Raspberry Pi hasn't had a hang in over a month. I checked the number of files in use today using:
sudo -u openhab lsof | wc -l
and it shows over 62K handles in use by OpenHab. It increases to this level shortly after starting OH and stays around this number while running. I don't have that many items or images. I do use the caching with the HTTP binding to poll a single URL every 10 seconds. My OpenHab setup is not that complicated so I don't know why it is using so many handles.
Command
sudo lsof | grep openhab | sort -n | uniq -c
on my Rasp shows the same:
1 java 861 997 openhab mem REG 179,2 281926 136625 /var/lib/openhab2/cache/org.eclipse.osgi/129/0/bundleFile
1 java 861 997 openhab mem REG 179,2 284220 136630 /var/lib/openhab2/cache/org.eclipse.osgi/31/0/bundleFile
1 java 861 997 openhab mem REG 179,2 284383 136779 /var/lib/openhab2/cache/org.eclipse.osgi/144/0/bundleFile
1 java 861 997 openhab mem REG 179,2 2860688 1826 /usr/lib/locale/locale-archive
1 java 861 997 openhab mem REG 179,2 2871546 136780 /var/lib/openhab2/cache/org.eclipse.osgi/145/0/bundleFile
1 java 861 997 openhab mem REG 179,2 29060 136722 /var/lib/openhab2/cache/org.eclipse.osgi/99/0/bundleFile
1 java 861 997 openhab mem REG 179,2 29296 136744 /var/lib/openhab2/cache/org.eclipse.osgi/117/0/bundleFile
1 java 861 997 openhab mem REG 179,2 294723 263506 /var/lib/openhab2/cache/org.eclipse.osgi/208/0/.cp/lib/okhttp-2.3.0.jar
1 java 861 997 openhab mem REG 179,2 29915 136693 /var/lib/openhab2/cache/org.eclipse.osgi/78/0/bundleFile
1 java 861 997 openhab mem REG 179,2 30003 136499 /var/lib/openhab2/cache/org.eclipse.osgi/128/0/bundleFile
1 java 861 997 openhab mem REG 179,2 30592 1974 /lib/arm-linux-gnueabihf/libnss_compat-2.19.so
1 java 861 997 openhab mem REG 179,2 307974 136756 /var/lib/openhab2/cache/org.eclipse.osgi/127/0/bundleFile
1 java 861 997 openhab mem REG 179,2 31161 263507 /var/lib/openhab2/cache/org.eclipse.osgi/208/0/.cp/lib/org.apache.oltu.oauth2.client-1.0.0.jar
1 java 861 997 openhab mem REG 179,2 31229 262584 /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar
1 java 861 997 openhab mem REG 179,2 31666345 262107 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/rt.jar
1 java 861 997 openhab mem REG 179,2 316843 136721 /var/lib/openhab2/cache/org.eclipse.osgi/98/0/bundleFile
1 java 861 997 openhab mem REG 179,2 32173 136726 /var/lib/openhab2/cache/org.eclipse.osgi/103/0/bundleFile
1 java 861 997 openhab mem REG 179,2 324677 262124 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/jsse.jar
1 java 861 997 openhab mem REG 179,2 32704 262206 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/aarch32/libmanagement.so
1 java 861 997 openhab mem REG 179,2 32768 263478 /tmp/hsperfdata_openhab/861
1 java 861 997 openhab mem REG 179,2 354344 136679 /var/lib/openhab2/cache/org.eclipse.osgi/64/0/bundleFile
1 java 861 997 openhab mem REG 179,2 36261 136706 /var/lib/openhab2/cache/org.eclipse.osgi/87/0/bundleFile
1 java 861 997 openhab mem REG 179,2 376971 136702 /var/lib/openhab2/cache/org.eclipse.osgi/83/0/bundleFile
1 java 861 997 openhab mem REG 179,2 37699 136709 /var/lib/openhab2/cache/org.eclipse.osgi/90/0/bundleFile
1 java 861 997 openhab mem REG 179,2 37721 136710 /var/lib/openhab2/cache/org.eclipse.osgi/91/0/bundleFile
1 java 861 997 openhab mem REG 179,2 37757 136688 /var/lib/openhab2/cache/org.eclipse.osgi/73/0/bundleFile
1 java 861 997 openhab mem REG 179,2 37776 136689 /var/lib/openhab2/cache/org.eclipse.osgi/74/0/bundleFile
1 java 861 997 openhab mem REG 179,2 38269 262223 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/ext/sunec.jar
1 java 861 997 openhab mem REG 179,2 38612 1984 /lib/arm-linux-gnueabihf/libnss_nis-2.19.so
1 java 861 997 openhab mem REG 179,2 3861228 262218 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/ext/cldrdata.jar
1 java 861 997 openhab mem REG 179,2 38662 136703 /var/lib/openhab2/cache/org.eclipse.osgi/84/0/bundleFile
1 java 861 997 openhab mem REG 179,2 41267 136691 /var/lib/openhab2/cache/org.eclipse.osgi/76/0/bundleFile
1 java 861 997 openhab mem REG 179,2 41508 262157 /usr/lib/jvm/zulu-embedded-8-armhf/jre/lib/aarch32/libverify.so
1 java 861 997 openhab mem REG 179,2 420618 136699 /var/lib/openhab2/cache/org.eclipse.osgi/80/0/bundleFile
1 java 861 997 openhab mem REG 179,2 435804 1965 /lib/arm-linux-gnueabihf/libm-2.19.so
1 java 861 997 openhab mem REG 179,2 436937 136809 /var/lib/openhab2/cache/org.eclipse.osgi/170/0/bundleFile
1 java 861 997 openhab mem REG 179,2 44052 136705 /var/lib/openhab2/cache/org.eclipse.osgi/86/0/bundleFile
1 java 861 997 openhab mem REG 179,2 44136 136712 /var/lib/openhab2/cache/org.eclipse.osgi/93/0/bundleFile
With a sum of:
[15:55:34] Kanashii@kokoro:~$ sudo lsof | grep openhab | wc -l
61173
So seems openhab on Rasp requires of 61173 o maybe some more depending on the osgi modules loaded to run.
Maybe the fix is so simple as raise the openhab user open file limit to "65536" on the limits.conf. Can anyone set it on the default OpenHabian image ?
If you're not using the OpenHabian image then it must be explained (raise limits) on the installation process.
Keeping in mind the values you told I'd double the maximum.
Have the same issuse. i only have the problem with open visu (Basic UI, Habpanel) on my Wall Tablet. after closing i have no problem so far. with tablet on i only works one day
Hi all,
I'm currently refactoring the systemd service file for the automatic installs (which includes openHABian). Can someone experiencing this issue (@pirndi, @jwarcd) try adding the following line underneath restart-on=failure
to /usr/lib/systemd/system/openhab2.service
LimitNOFILE=102642
Other changes mentioned in this thread should be set back to default to test if the above line actually does anything.
Same problem here on a Raspi3. LimitNOFILE=102642
makes it only worse -> 30min after reboot: RAM usage up to 100%, SWAP usage
sudo lsof | grep openhab | wc -l
shows:
1290522
Please have a look at the discussion here:
https://community.openhab.org/t/java-io-ioexception-too-many-open-files/28204/39
I've performed several tests with PiZeroW and Pi3
My conclusion: The browser client opens in case of a manual user refresh lots of connections to the chart service of openhab.
Dear all, I have the same issues. I use BasicUI. I have my webpage always loaded on my touchpanel... I can see the increment of the number of : lsof -p PID | wc -l And when this number is too big, my openhab call an error: too many file open... I have to restart my openhab to clean memory. Do you have a solution ? Restart macOS each day ? Use ClassicUI ?
Let's assume this issue has been fixed by now.
Hello!
I'm running openHAB 2 (stable) on a Raspberry Pi3, and from time to time the system becomes unreachable (neither WebUI, nor ImperiHome, nor SSH work) and the logs show the following exception:
I have to unplug the power source and re-power the Pi to get openHAB up and running again. Seems that in the code things are not closed properly!?