Sudden restart of the gateway

When java is told different initial and max memory settings, it starts low and requests more from the OS as memory usage climbs. So it might not reach the max setting for some length of time. In that interval, the OS would be likely to have occupied all memory with buffers, some of which would need flushing to satisfy a java request for more towards its max. Flushing buffers is not instant. It is best for java to claim its memory up front so the OS never uses it for buffers.