Skip to main content

Posts

Showing posts from October, 2015

CATALINA_OPTS vs JAVA_OPTS

JAVA_OPTS may use by Other applications, but only Tomcat will use CATALINA_OPTS. So if you're setting environment variables for use only by Tomcat, you'll be best advised to use CATALINA_OPTS, whereas if you're setting environment variables to be used by other java applications as well, you should put your settings in JAVA_OPTS. What can go in there! You can increase heap memory available to the JVM. You can open remote monitoring ports so that Jconsole on another system can watch how your Tomcat is running. You can add in a -server to switch from the client (quicker start, slower running) JVM to the server (slower starting, quicker running) JVM. You can increase java thread stack size using the -Xss option (same way to specify amount of memory as in -Xms and -Xmx as described in the "increase heap memory" link above. for more visit : http://www.sanjeevrathaur.com/2015/10/javaopts-variable-details.html

JAVA_OPTS Variable Details

Memory Available to the Java JVM Increasing the memory available to the Java JVM JAVA_OPTS="-Xmx1024m -Xms256m" export JAVA_OPT Options description: -Xmx sets the maximum amount of memory that can be allocated to the JVM heap; here it is being set to 1024 megabytes. -Xms sets the initial amount of memory allocated to the JVM heap; here it is being set to 256 megabytes. Run Java JVM in Server Mode The Java JVM can optimize a number of things for server environments. You can explicitly select the Java HotSpot Server VM with the -server option. JAVA_OPTS="-Xmx1024m -Xms256m -server" export JAVA_OPT What the option means: -server instructs the launcher to use the Java HotSpot Server VM. PermGen Memory If you start getting java.lang.OutOfMemoryError: PermGen space error messages. You may want to include a "-XX:MaxPermSize" option in your JAVA_OPTS. JAVA_OPTS="-Xmx1024m -Xms256m -server -XX:MaxPermSize=128m" export