The issue is that if Xmx option is not defined explicitly, then JVM uses 1/4th of all memory available for the host OS due to a default internal garbage collection (GC) ergonomic algorithm. This can lead to killing the Java process by the kernel if JVM memory usage grows over the cgroups limit defined for a Docker container.
To solve this problem, one improvement was recently implemented in OpenJDK 9 and backported to OpenJDK 8 in version 8u131.
As we are using later version of Java 8 on both Alpine and Redhat container, we are going to update the light-codegen to add these options in the java command line. Once this is done, we can control the container memory limitation with Kubernetes deployment configuration file.