Java Out Of Memory Error with OpenHab 2.5.5 - Seeking Solutions

Greetings, fellow automation enthusiasts! I’ve recently encountered a frustrating issue with my OpenHab setup, and I’m hoping the collective wisdom of this community can shed some light on potential solutions.

The Issue at Hand:
Over the past few days, my OpenHab installation has been throwing Java Out Of Memory Errors, which has significantly impacted its performance. The logs are littered with entries like this:

Jun 21 00:01:49 raspberrypi karaf[494]: Exception in thread “WebSocketClient@16653809-13598”
Jun 21 00:01:49 raspberrypi karaf[494]: Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “WebSocketClient@16653809-13598”

System Configuration:- Hardware: Raspberry Pi 4 - 4GB RAM

  • OS: Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux
  • Java Version: openjdk 11.0.7 2020-04-14 LTS
  • OpenHab Version: 2.5.5

Observations:- The errors seem to occur more frequently during periods of high activity, such as when multiple devices are communicating over MQTT or when rules are executing.- While the system remains functional, the responsiveness has noticeably degraded, which is impacting my daily routines and automations.

**Steps Taken So Far:**1. Increased Heap Size: I’ve tried adjusting the heap size in the OpenHab configuration, but this hasn’t resolved the issue entirely.
2. Log Analysis: Reviewing the logs has pointed towards memory leaks or excessive memory usage by certain components, but pinpointing the exact culprit has been challenging.
3. Component Review: I’m currently evaluating which add-ons or rules might be contributing to the memory load, but I’m not sure where to start.

**Seeking Your Expertise:**I’d greatly appreciate any insights or strategies to tackle this problem. Whether it’s advice on optimizing the current setup, identifying memory-intensive components, or even considering an upgrade, your suggestions would be invaluable.

Let’s collaborate to keep our smart homes running smoothly! Looking forward to your thoughts and experiences.

Best regards,
Tobias