You could try adding this to your shell profile export _JAVA_OPTIONS=-Xmx2048m to assign more memory to Java by defualt
References
https://stackoverflow.com/questions/6064112/how-to-set-default-maximum-heap-size-for-java-xmx-for-linux-centos
https://askubuntu.com/questions/542585/how-to-increase-java-heap-size