OH3 OutOfMemory Exceptions

Hello,

I’m running OH3 in a docker container (openhab/openhab:3.0.0-alpine). During the last days I’ve run into some OutOfMemory Exceptions (usually occured at some time in the night):

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “items-queue”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “OH-scheduler-1460”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “OkHttp Dispatcher”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “OH-startlevel-1”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “Karaf Lock Monitor Thread”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “OkHttp ConnectionPool”
Exception in thread “Active Thread: Equinox Container: 52a67f1f-75da-4d09-8171-c7601a620201” Exception in thread “encryption-1-thread-1” Exception in thread “upnp-main-1”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “HttpClient@3588ebb0-182”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “OH-karaf-addons-1”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “fileinstall-/openhab/addons”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “RRD4J Sync-ThreadPool for org.rrd4j.core.RrdSyncThreadPool@575d55a4 [Thread-2]”
Exception in thread “Timer-6” java.lang.OutOfMemoryError: Java heap space
Exception in thread “items-226” java.lang.OutOfMemoryError: Java heap space
Exception in thread “jupnp-jetty-client-214” java.lang.OutOfMemoryError: Java heap space
Exception in thread “OkHttp ConnectionPool” java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread “EventThread” java.lang.OutOfMemoryError: Java heap space
Exception in thread “SocketListener” java.lang.OutOfMemoryError: Java heap space
Exception in thread “OkHttp Dispatcher” java.lang.OutOfMemoryError: Java heap space
Exception in thread “safeCall-58” Exception in thread “OH-OSGiEventManager” io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: What's different in 2.0 · ReactiveX/RxJava Wiki · GitHub | java.lang.OutOfMemoryError: Java heap space
Exception in thread “OH-discovery-1526” Exception in thread “OH-thingHandler-985” Exception in thread “OH-thingHandler-977” Exception in thread “RRD4J Sync-ThreadPool for org.rrd4j.core.RrdSyncThreadPool@575d55a4 [Thread-6]” Exception in thread “OkHttp Dispatcher” at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
Exception in thread “RxComputationThreadPool-1” java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: What's different in 2.0 · ReactiveX/RxJava Wiki · GitHub | java.lang.OutOfMemoryError: Java heap space
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.OutOfMemoryError: Java heap space

I’ve not set any specific memory limits during the container creation.

Do you have any idea? Or should I simply increase the Java Heap Size?

Thanks!

Find anything out? Just had my first event with similar errors…

java.lang.OutOfMemoryError: Java heap space

OpenHABian on a RPI4

I also have this.

Please open an issue on GitHub for this with as much detail as possible. LogFiles from the exception as well as the system information is crucial in order to analyze this

Did you create DSL rules via the UI? That causes those errors in the 3.0.0 Release build.

See also: OpenHab 3 / OpenHabian runs out of memory / java heap space errors, CPU 100%+ after a few hours

and: https://github.com/openhab/openhab-distro/issues/1233

Thanks for the link to the forum topic as well as for the GitHub issue.

According to the description it could be the same issue on my side, since I created DSL rules via the UI and experienced a very slow execution of the rules.

I’ll test the latest snapshot build (I couldn’t find an information when the next Patch-Release is planned) and let you know if this solved the problems.

After running the latest snapshot version for a few days, I can confirm that the OutOfMemory Exceptions are gone.