Openhab2 crashes every 2 days

My fresh openhab2 Installation with openhabian crashes every 2 days.
And I don’t know where to find the error.

this is the open.log:

tail -f /var/log/openhab2/openhab.log
java.lang.OutOfMemoryError: Java heap space
2018-11-08 06:30:18.748 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception
java.lang.OutOfMemoryError: Java heap space
2018-11-08 06:30:18.748 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception
java.lang.OutOfMemoryError: Java heap space
2018-11-08 07:16:14.812 [WARN ] [e.jetty.util.thread.QueuedThreadPool] -
java.lang.OutOfMemoryError: Java heap space
2018-11-08 07:16:14.818 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - Unexpected thread death: org.eclipse.jetty.util.thread.QueuedThreadPool$2@17f13e8 in HttpClient@18689837{STARTED,8<=8<=200,i=1,q=0}
2018-11-08 07:20:24.933 [WARN ] [l.LateInvalidatingHashSessionManager] - Problem scavenging sessions
java.lang.OutOfMemoryError: Java heap space

if I request the status with :
sudo systemctl status openhab2.service

I get the following output:

● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2018-11-09 11:03:55 CET; 4s ago
Docs: https://www.openhab.org/docs/
https://community.openhab.org
Process: 17668 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
Process: 17548 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
Main PID: 17548 (code=exited, status=1/FAILURE)

Nov 09 11:03:55 openHABianPi systemd[1]: openhab2.service: Control process exited, code=exited status=1
Nov 09 11:03:55 openHABianPi systemd[1]: openhab2.service: Unit entered failed state.
Nov 09 11:03:55 openHABianPi systemd[1]: openhab2.service: Failed with result ‘exit-code’.

Thank you for any help

I have not seen anything similar. What is the version of openHAB?
What computer platform are your on?

(Have you overclocked the computer perhaps??)

You are using a faulty binding or script that steadily consumes more and more memory until your system runs out of memory and the Out of memory killer ends the java process.

Check your scripts for timer creation. Most people create timer, but never think about releasing them again.
Check for more esoteric bindings, that probably not many people use and the chance is more likely that a resource leakage was not identified yet.

Cheers, David

When your system has been running for a while you could make a heap dump and then analyze where all the memory is consumed with Eclipse Memory Analyzer Tool (MAT). If you configure the runtime such that it will always write a heap dump on OOM errors you can always analyze them after they just occurred.

See also:

While not a remedy, increasing Java heap space may help.
(and if for some accidential reason you used a too small value it might even be the right fix).
Use -Xmx512m to double the default. You can add this to EXTRA_JAVA_OPTS in /etc/default/openhab2.

Thank you very much for your fast help.
It is a fresh install of openhabian with openHAB 2.3.0-1 (Release Build).
I’ll try to deactivate some bindings to first.