- Platform information:
- Hardware: Raspberry Pi 4 model B (4 GB RAM)
- OS: Raspberry Pi OS / x64 / 12 (bookworm)
- Java Runtime Environment: OpenJDK 64-Bit Server VM version 17.0.9+9-Debian-1deb11u1
- openHAB version: 4.1.1 (running in Docker)
- ConBee 2 USB stick
- Output of openHAB’s console
shell:info
:
Karaf
Karaf version 4.4.4
Karaf home /openhab/runtime
Karaf base /openhab/userdata
OSGi Framework org.eclipse.osgi-3.18.0.v20220516-2155
JVM
Java Virtual Machine OpenJDK 64-Bit Server VM version 17.0.9+9-Debian-1deb11u1
Version 17.0.9
Vendor Debian
Pid 27
Uptime 5 days 23 hours
Process CPU time 1 hour 24 minutes
Process CPU load 0.00
System CPU load 0.04
Open file descriptors 230
Max file descriptors 1,048,576
Total compile time 14 minutes
Threads
Live threads 193
Daemon threads 112
Peak 204
Total started 256941
Memory
Current heap size 306,941 kbytes
Maximum heap size 972,800 kbytes
Committed heap size 481,280 kbytes
Pending objects 0
Garbage collector Name = 'G1 Young Generation', Collections = 465, Time = 12.390 seconds
Garbage collector Name = 'G1 Old Generation', Collections = 0, Time = 0.000 seconds
Classes
Current classes loaded 34,110
Total classes loaded 43,396
Total classes unloaded 9,286
Operating system
Name Linux version 6.1.21-v8+
Architecture aarch64
Processors 4
Total physical memory 3,885,396 kbytes
Free physical memory 41,056 kbytes
Dear community,
I recently noticed that my Raspi reached its memory (i. e. RAM) limits and I wanted to know which apps consume the most.
I have several smaller apps that I developed myself and therefore I’m aware of their memory implications. However, openHAB’s memory footprint surprises me a bit - but of course, since I’m not familiar with the codebase, this is not a complaint
Here’s a htop
screenshot of my system:
As you can see, openHAB takes 1 GB. What I also noticed is that when changing the htop
view so that threads are displayed rather than processes, there are approx. 100 threads related to openHAB. This is probably due to the following setting that I had to set within /opt/openhab/conf/services/runtime.cfg
to get rid of openHAB’s startup error Error while connecting: Insufficient configured threads: required=11 < max=10 for QueuedThreadPool[OH-httpClient-nz-deconz-72aca4f3f1]@756c419e{STARTED,5<=5<=10,i=1,r=-1,q=0}[ReservedThreadExecutor@552afaf8{reserved=0/1,pending=0}]
:
org.openhab.webclient:minThreadsShared = 10
org.openhab.webclient:maxThreadsShared = 120
org.openhab.webclient:minThreadsCustom = 10
org.openhab.webclient:maxThreadsCustom = 120
After searching a bit in this forum, I found several threads about memory problems, etc. This left me a bit unsure whether I should try to reduce openHAB’s memory usage on my current Raspi or instead buy another Raspi 4 with 8 GB RAM
What am I using openHAB for?
- Capture temperature data from 8 sensors via ZigBee
- Control three LED lights via ZigBee
So here are my questions:
- Taking the above information into account, does 1 GB of memory seem like a reasonable high memory usage for you?
- Is there any way to reduce the number of threads without facing the aforementioned startup problem?
- Is it worth tuning openHAB’s memory usage (e. g. via JVM parameters) or would you rather recommend upgrading my Raspi to 8 GB?
Best regards and thx!