openHAB on Raspberry Pi freezes for a couple of minutes

My guess would be it’s paging (swapping).
Check out my hints on optimizing swap here.
A patch to add zram compression is in the pipe for openHABian.