URGENT: openhab 4.3.5 constantly restarting

  • Platform information:

    • Hardware: Raspberry pi 5
    • 8Gb Ram
    • OS: openhabian
    • Java Runtime Environment: Temurin-21.0.7+6
    • openHAB version: 4.3.5
  • Issue of the topic: openhab crashes and restart continuously

  • Please post configurations (if applicable):

    • the volume for RRD4j filled up and I had to remove some files to allow the system to recover
    • I added influx & grafana through openhabian-config
    • I added added the influx persistence and configured
  • Additional:

    • noticed just before the system crashed that when navigating to the persistence settings it was showing no (0) persistence installations and settings
    • I was able to query the API and get the Persistence id’s and settings returned
    • I have tried to increase the size of heap allocated with the commands below
EXTRA_JAVA_OPTS="-Xms512m -Xmx2048m -XX:-TieredCompilation -XX:+ExitOnOutOfMemoryError -Dxtext.qn.interning=true -Duser.timezone=Europe/Madrid"

I have also shut down all extra processes (Influx/grafana/mosquito) and its still crashing

I cannot determine why the system keeps crashing but it appears there may be some corruption causing the memory usage, is there anyway to determine what is causing the crash

THANKS for any guidance

Jun 24 18:40:05 openhabian sudo[1065]: pam_unix(sudo:session): session closed for user openhabian
Jun 24 18:40:05 openhabian sudo[27637]: pam_unix(sudo:session): session closed for user root
Jun 24 18:41:23 openhabian sudo[27676]: openhabian : TTY=pts/0 ; PWD=/etc/default ; USER=root ; COMMAND=/usr/bin/vi openhab
Jun 24 18:41:23 openhabian sudo[27676]: pam_unix(sudo:session): session opened for user root(uid=0) by openhabian(uid=1000)
Jun 24 18:41:33 openhabian sudo[27676]: pam_unix(sudo:session): session closed for user root
Jun 24 18:41:43 openhabian sudo[27682]: openhabian : TTY=pts/0 ; PWD=/etc/default ; USER=root ; COMMAND=/usr/bin/systemctl start openhab.service
Jun 24 18:41:43 openhabian sudo[27682]: pam_unix(sudo:session): session opened for user root(uid=0) by openhabian(uid=1000)
Jun 24 18:41:43 openhabian systemd[1]: Starting openhab.service - openHAB - empowering the smart home...
Jun 24 18:41:43 openhabian systemd[1]: Started openhab.service - openHAB - empowering the smart home.
Jun 24 18:41:43 openhabian sudo[27682]: pam_unix(sudo:session): session closed for user root
Jun 24 18:42:24 openhabian karaf[27687]: Fetching gem metadata from https://rubygems.org/...........
Jun 24 18:42:24 openhabian karaf[27687]: Resolving dependencies...
Jun 24 18:42:24 openhabian karaf[27687]: Using bundler 2.3.26
Jun 24 18:42:24 openhabian karaf[27687]: Using marcel 1.0.4
Jun 24 18:42:24 openhabian karaf[27687]: Using method_source 1.1.0
Jun 24 18:42:24 openhabian karaf[27687]: Using openhab-scripting 5.39.0
**Jun 24 18:42:43 openhabian karaf[27687]: Terminating due to java.lang.OutOfMemoryError: Java heap space**
Jun 24 18:42:43 openhabian systemd[1]: openhab.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Jun 24 18:42:43 openhabian systemd[1]: openhab.service: Failed with result 'exit-code'.
Jun 24 18:42:43 openhabian systemd[1]: openhab.service: Consumed 2min 9.570s CPU time.
Jun 24 18:42:48 openhabian systemd[1]: openhab.service: Scheduled restart job, restart counter is at 1.
Jun 24 18:42:48 openhabian systemd[1]: Stopped openhab.service - openHAB - empowering the smart home.
Jun 24 18:42:48 openhabian systemd[1]: openhab.service: Consumed 2min 9.570s CPU time.
Jun 24 18:42:48 openhabian systemd[1]: Starting openhab.service - openHAB - empowering the smart home...
Jun 24 18:42:48 openhabian systemd[1]: Started openhab.service - openHAB - empowering the smart home.

Create a heap dump and analyze it to figure out what is filling up your memory so much that openHAB crashes.

See posts like: …

1 Like

@wborn thanks - i will look but that page is not accessible to me

Ah yes I see that you cannot see it. But I have a new link for you :slight_smile:

Hello all so I have the Report From Eclipse MAT

Not sure I understand 100% but

Seems that “mapdb” is a problem for the objects i collect from my Lithium Iron Batteries - Not sure why though -

I would not have thought mapdb would cause this because it should onl;y hold the last value

Can I tell openHAB to start without persistence if this is the issue

I have a 5 day old backup (so not minor but recoverable changes and discoveries and I have the last json db backups to troll trough for pointers on changes needed.)

Could i Move the whole of mapdb files/folder/directory somewhere else and restart openHAB?

Mapdb files do not see overly big but they are mixed text and binary (using cat) so not sure what they should look like

-rw-rw-r-- 1 openhab openhab     34K Jun 24 20:54 storage.mapdb
-rw-rw-r-- 1 openhab openhab     67M Jun 24 20:54 storage.mapdb.p
-rw-rw-r-- 1 openhab openhab      16 Jun 24 20:54 storage.mapdb.t

Any further advice

@wborn thanks for your guidance. I was able to discover the mapdb was corrupt and deleted it and restarted the system . I will put a small outline/report here tomorrow for others future reference but for now its closed - thanks

1 Like

Happy to hear that! Without inspecting an actual heap dump, it’s like trying to solve a jigsaw puzzle blindfolded. :upside_down_face: