That is probably hugely overkill to dedicate 16 GB of RAM to OH right out of the gate.
I’ve found The Doctor Binding helps find issues with your system [4.0.0;4.9.9] to be an easy way to track and understand how OH is using the heap. At a minimum I’d set the -Xms property much lower (maybe 4G) and let Java grab more ram as it needes it. That -Xms property causes Java to reserve that much RAM when it starts up whether or not it’s ever going to use it.
Unless jRuby is horribly ineffecient with RAM, which I highly doubt, you don’t have so many Items and Thing to require 16 GB of RAM to run in. But The Doctor addon can show you for sure.
For comparison I have 380 Items, 80 Things, and 74 rules and even with the default settings (which I think is 1g) I’m using less than 10% of the heap after garbage collection.
I mainly don’t want future readers of the forum to think that 16g is a normal amount of RAM to dedicate to OH.
That’s Rules DSL, not Java. It’s a custom programming language created by and for OH and, frankly, it has fallen behind in a number of ways. I do not recommend new development of rules using Rules DSL because of that. But that’s not the topic of this thread.
Knowing that you are using Rules DSL though does help analyze the performance though.
I’m less convinced but The Doctor add-on I linked to above should tell us if that’s the case. There is one Channel you can link to an Item and generate a chart of the heap usage over time. Perhaps there is an issue when garbage collection kicks in? We can correlate when that happens to when the delay to Alexa et al occurs. GC happened when the chart drops.