Java heap space.....java.lang.OutOfMemoryError

Hi

still tinkerboard - Debian 10 - openhab 2.5.5_1
another warning:
2020-06-12 22:56:28.026 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /start/index
java.lang.OutOfMemoryError: Java heap space
2020-06-12 22:56:38.624 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /start/index
java.lang.OutOfMemoryError: Java heap space

and the system has stopped !!

What happens with 2.5.5 an java? endless story?

Could anyone help and explain and fix!

Cheers
Stef

Are you using the Amazon Control Binding? If so there are a few topics regarding this and for now the only fix is to stop the binding. An issue has been opened on github so you may want to follow up there.

If no Amazon Binding is being used please list what binding you are using and if you’ve modified the EXTRA_JAVA_OPTS.

Yes i use…

but if i unistall the binding!!! the web socket error still exist!!!

do say it as clear as possible°!!!: i uninstall the binding!!! i reboot the system!!! the web socket error ist still there!!!

so schwer kann das doch nicht zu verstehen sein … man man man

oh man

You do not have to uninstall the binding as it can simply be stopped using the karaf console.

Try stopping OH and cleaning the cache.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

Or you can try restarting OH a few times, no reboot just restart.

sudo systemctl restart openhab2

After cleaning the cache -the error is gone! Good!!! Very good - Thanks a lot!

But i have cleaned the cache by hand - deleting everything underneath /var/lib/openhab2 … as often descripted in the forum

Is there a differenz using the the command and deleting the cache files?

So in my eyes there shoud a automatic clear funktion be implemented!!

Thanks
Cheers Stef

another Question:

during the stop of openhab - using: sudo systemctl stop openhab2

The log shows:

2020-06-13 19:46:32.272 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2020-06-13 19:46:41.872 [INFO ] [control.internal.WebSocketConnection] - Web Socket error {}
java.nio.channels.AsynchronousCloseException: null
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.close(HttpConnectionOverHTTP.java:181) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1257) [?:1.8.0_252]
at org.eclipse.jetty.client.AbstractConnectionPool.close(AbstractConnectionPool.java:208) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.DuplexConnectionPool.close(DuplexConnectionPool.java:237) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpDestination.close(HttpDestination.java:385) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:260) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:371) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) [bundleFile:9.4.20.v20190813]
at org.openhab.binding.amazonechocontrol.internal.WebSocketConnection.close(WebSocketConnection.java:159) [bundleFile:?]
at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.closeWebSocketConnection(AccountHandler.java:349) [bundleFile:?]
at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.cleanup(AccountHandler.java:272) [bundleFile:?]
at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.dispose(AccountHandler.java:237) [bundleFile:?]
at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

as you can see: there is the Web Socket error {} again!
maybe this helps to find out what is the real problem!

Cheers
Stef

The issue is the Amazon control binding.

Glad it worked for you. :+1:

Using openhab-cli clean-cache also deletes the tmp file. You could do this manually but I prefer one command that handles both.

Hi having a question again… maybe to CM6.5 H102 … regular

Is it possible to restart the openhab system like:
“systemd Auto-restart a crashed service in systemd”
as discripted here: http://kb.ictbanking.net/article.php?id=654&oid=2

and how must/should the " openhab2.service " be modify to do that?

This could be - in my eyes - a work arround until socket error caused by amazon binding is fixed.

Thanks for help
Cheers Stef

Sorry, I can’t answer the question about using systemd for auto restarting OH. IMHO this is not something that should be done if you have frequent errors.

Have you stopped the Amazon Control Binding and still getting web socket errors?

You can install the OH in the Alexa app and still control most of your devices as the issue is only with the control binding.

EDIT: See this post for a possible solution Web Socket Error on AmazonEchoControl binding every 65 seconds
You will need to download the jar file and place it in /usr/share/openhab2/addons then restart OH. Or you can use the console as described in the post.

Thanks to CM6.5 H102Regular for your quick response…

You are right, that this is not a normal way to restart service automaticly…

Thanks for forwarding the possible solution…
but it did not work:
here the error in the log again very 65 secounds

2020-06-15 13:40:53.993 [INFO ] [control.internal.WebSocketConnection] - Web Socket error
java.nio.channels.AsynchronousCloseException: null
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.close(HttpConnectionOverHTTP.java:181) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1257) [?:1.8.0_252]
at org.eclipse.jetty.client.AbstractConnectionPool.close(AbstractConnectionPool.java:208) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.DuplexConnectionPool.close(DuplexConnectionPool.java:237) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpDestination.close(HttpDestination.java:385) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.client.HttpClient.doStop(HttpClient.java:260) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:180) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:201) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.websocket.client.WebSocketClient.doStop(WebSocketClient.java:371) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:93) [bundleFile:9.4.20.v20190813]
at org.openhab.binding.amazonechocontrol.internal.WebSocketConnection.close(WebSocketConnection.java:159) [bundleFile:?]
at org.openhab.binding.amazonechocontrol.internal.WebSocketConnection$2.run(WebSocketConnection.java:184) [bundleFile:?]
at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_252]
at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_252]

I think it is better to close this topic and forward all others to
Web Socket Error on AmazonEchoControl binding every 65 seconds

to bring all informations to the same topic, in this case the topic which works on amazon bindung which is the cuase of the crash!!!

so all readers please follow Web Socket Error on AmazonEchoControl binding every 65 seconds

You could monitor the openhab process with something like monit and restart it if intus lost.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.