Closed StefanSchubert closed 3 years ago
Update:
I did some analysis in between and found a solution to the issue, which has nothing do do with the pi4j lib so the issue is closed. For those who are curious:
My SpringBoot App using the pi4j runs on openJDK 11 which causes that Apps jar file is in fact being extracted at /tmp as well as hsperf Data along with the tomcat folders to store tmp upload files. However the App is accessing the exploded Jar libs and the JVM hsperf at runtime. Now there are default cronjobs of the debian on the pi which cleans up /tmp data. Now guess what? Sure the App crashed and it seems that it do it in such a way that will slow down the pi as well through "overheating" so that is is no longer responding. I fixed the issue in my case by disabing hsperf and moving the exploded jars by making use of -Djava.io.tempdir
Took me quite a while to figure that out %-)
Thanks for the update @StefanSchubert and clear description! I wrote a proof-of-concept Spring application, so will definitely take a look into this "-Djava.io.tempdir" argument.
Welcome @FDelporte , here are the exact JVM config: JAVA_OPTS="-Djava.io.tmpdir=/var/pibell/tmp -XX:-UsePerfData"
one problem might be, that now through restarts of the app, the new tmp dir will grow with exploded libs. You may consider own housekeeping for that. Take also into account that the behavior according exploding the JAR seems to differ between JVMs. I observed it with openjdk 11.0.9.1 2020-11-04 and I haven't quite understood what leads to the exploding jar behavior. I have severals Apps running on pis all based on spring boot and though the poms are almost identical, all but this one app, leave the jar (which is built as executable to run as a service) untouched.
Hi there,
first thanks a lot for offering a java interface to PIs GPIO - this is really great and I'm quite happy with it ππ»
However from time to time my pi crashes and it seems that there is a bug or miss configuration in the event handling of pi4j.
Has someone observed this behavior before? I'm using the core lib in version 1.4 on a pi modell 3. My Application is just reading out a single GPIO Pin which works quite well. In HTOP on the PI I can observer a more or less steady number of threads belonging to the app. When the event I listen for occurs I see plus 2-3 more threads but they will disappear after a couple of minutes. I would say the number of threads looks steady. However after running round about a day the pay crashes and I can observe the stacktrace in syslog.
Ah and I added actuator/prometheus/grafana to observer if there is a problem with heap sizes etc...everything there is within bounds. No much memory consumption, nice GC runs etc.
Greeting from Germany Stefan