OH4 runs out of memory

Hello @markus7017
I wanted to try it also to test the issue with the Wall Screen but installing the new Jar gives me thi> s error:

Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.shelly-4.1.0-SNAPSHOToom.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.shelly [305]
Unresolved requirement: Import-Package: com.google.gson; version=“[2.10.0,3.0.0)”
at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

Maybe because i’m on OH 4.0.3??

urg, gson is one of the core packages and shpuld be always there

4.0.3 should be fine

try

  • delete the jar, stop OH
  • openhab-cli clean-cache
  • start OH, wait 5min until cache is recreated
  • open OH console
  • enter „ feature:install oh-transport-coap“
  • copy jar to addins folder
  • wait a bit and check with bundle:list that binding is Active

I had that same problem. I resolved it by first upgrading my whole openhab to the latest snapshot release (changing my sources.list to include unstable), then upgrading to the new jar. I think it’s a newer version of gson required - so you have it, but not a new enough version.

I did manually upgrade gson, which you can do, but it then asked for a different jar to be upgraded as well, and I decided I’d be chasing my tail.

Overnight, no new threads created. Working well so far.

I created PR #15198, which includes those fixes. There is a good chance that it also goes into 4.0 (beside next 4.1 milestone build)

I am suffering from oom since 4.0.3. I tried to use your jar without look under 4.0.3. Updated to 4.1 unstable but no luck either. Got massive Exceptions. Is there any special Version of 4.1 to use your jar with ?

I just ran directly against unstable - so I updated using APT to the full unstable, then used the console to update just that one jar using the link provided.

What exception exacatly are you getting? Is it the Gson one?

Updating via console did the trick. Thank you. Fixed my OOMs instantly.

Might be not related since I am still running OH 3.4.4, but I was suffering OOM for few weeks and it was defenetly the Nest binding.
I stopped such binding for several days and solved. Today I restarted it and the out of memory problem came back in few hours.
It’s a real pity that this device had such troubles with account, support and functionality confusion.

This isn’t the nest binding though, it’s the Shelly binding.

I’m juat finalizing the PR

It’s the shelly binding for me too.
Markus’s solution works for me. No more out of memory errors anymore.

PR #15798 is ready to merge, check out: [shelly] Fix resource leak, BLU script installation, TRV init, NPE on IPv6 mDNS discovery by markus7017 · Pull Request #15798 · openhab/openhab-addons · GitHub
which includes OOM Fix #2 and #3 and some other important fixes.
since then you could use https://github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-4.1.0-SNAPSHOToom.jar?raw=true

1 Like