Suppose on my machine [x64, linux, 8g Ram], I set heap at JAVA_OPTS=-Xmx2048m and for tomcat as CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m".
Now at any moment, the memory requirement of application in tomcat goes beyond heap size specified at CATALINA_OPTS.
Will it give Out of Memory error? OR it will work without an issue as there is plenty of memory given to JVM(by JAVA_OPTS)?