openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
820 stars 251 forks source link

OpenJDK w/ OH3.2 fails to start #1637

Closed mstormi closed 2 years ago

mstormi commented 2 years ago

systemd journalctl saying Dez 20 13:09:30 openhab karaf[9308]: Initial heap size set to a larger value than the maximum heap size

although mem params were not changed

[13:19:50] root@openhab:/etc/default# grep ^EXTRA openhab
EXTRA_JAVA_OPTS="-Xms192m -Xmx384"
[13:19:50] root@openhab:/etc/default#

I used option 45 to migrate Zulu to OpenJDK

Commenting out that line makes java start without Xms / Xmx which seems to work. Wondering why this happens though, and those are the openHABian defaults so anyone (anyone to migrate via 45 only?) could be affected.

ecdye commented 2 years ago

That is very odd, I use OpenJDK but not seen this error. @mstormi check openhab.bash line 213 your values are not the defaults that openHABian set. What happens if you use the default values?

EDIT: Also make sure that you add the m to the end of the -Xmx value as it specifies the units.

mstormi commented 2 years ago

Yes I changed defaults but missed the missing m when editing. That is the explanation for the irritating error (which should not be there as Xms < Xmx but if not or wrongly specified java probably uses the default which is system mem dependent and probably lower). So there's probably nothing wrong with openHABian.

I've hit that on my own production box after I upgraded that to 3.2. It kept refusing to properly startup openHAB with various symptoms. Hard to interpret but I now believe it was a combination of increased memory requirements to hit memory shortage, resulting in swapping, increased garbage collection etc which then in turn slowed down the whole startup process so much that I ran into other errors because of that such as the zwave queue filling or timeouts. I just couldn't get it to work for hours and ended up exchanging the hardware, now it's fine.