Java OutOfMemory runtime Configuration?

  • Platform information:
    • Hardware: Core I3, 16 GB , 512 HDD
    • OS: Win10 Pro
    • Java Runtime Environment: jdk1.8.0_181
    • openHAB version: 2.5.8 running as a windows service
  • Issue of the topic: OutOfMemoryException, Java using 850MB only

Hi all,

I had a couple od issues with performance and then went into the log and found : “OutOuMemoryException”.
Then went into taskmanager: 860MB only - more than half of mem of PC was free

Then I tried to set in global environment vars on the machine:
EXTRA_JAVA_OPTS “-Xms400m -Xmx4g”

Restareted service an computer a couple of times - same behaviour

Then startet openhab by “start.bat” and in karaf.bat I had changed:

rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage
if “%JAVA_MIN_MEM%” == “” (
if “%JAVA_MAX_MEM%” == “” (
rem set JAVA_MAX_MEM=512M

This has solved my memory issues and OH is now using more that 1GB Mem - seems that this is what it wanted and did’nt get before.

Now my question:

How can I do the same with the windows service instead of using the manual start via kara.bat?

Thank you for your help in advance.



found some configuration options for the wrapper config for the jetty server:
Is it right to do it like this?