Your build has exceeded the memory limit of 4G on 1 container

I imagine the error message is self-explanatory. Have you tried reducing the memory allocated to Java? What happens if you reduce the -Xmx2048m? I’d try 1G or 1.5G.

I am not particularly familiar with Java, but I recall when I’ve tweaked NetBeans, there are several memory settings to change in the JRE. It may be worth looking at several.