Recommended heap size

Running OH 4.1.1 on RPi4 4GB

There isn’t any specific heap size in Java_Opts, so I guess I’m running a default size?

shell:info shows

 Java Virtual Machine        OpenJDK Client VM version 17.0.9+9-Raspbian-1deb12u1rpt1
 Version                     17.0.9
 Vendor                      Raspbian
 Pid                         3101
 Uptime                      10 days 6 hours
 Process CPU time            2 days 4 hours
 Process CPU load            0.00
 System CPU load             0.67
 Open file descriptors       250
 Max file descriptors        102,642
 Total compile time          3 minutes
 Live threads                329
 Daemon threads              169
 Peak                        382
 Total started               641508
 Current heap size           247,527 kbytes
 Maximum heap size           253,440 kbytes
 Committed heap size         253,440 kbytes
 Pending objects             0
 Garbage collector           Name = 'Copy', Collections = 2695, Time = 40.018 seconds
 Garbage collector           Name = 'MarkSweepCompact', Collections = 76867, Time = 19 hours 21 minutes
 Current classes loaded      30,013
 Total classes loaded        316,182
 Total classes unloaded      286,169
Operating system
 Name                        Linux version 6.1.0-rpi7-rpi-v8
 Architecture                arm
 Processors                  4
 Total physical memory       3,883,276 kbytes
 Free physical memory        1,503,756 kbytes

253K heap seems rather small given how much memory I have…anyone have recommendations?

you can set minimum and maximum heap space via /etc/default/openhab. See this posting [SOLVED] Increasing RAM for Openhab - #6 by stefan.hoehn (for example…)

That is 253,000k or aka 253megabyte

If you want some heap guidence try this binding which is found in the Marketplace, and it will give a better break down of your heap usage in the DEBUG level logs and also give you a graph. If you need to change the heap it will give you a WARN message in the logs.