JVM tuning
Before we start with JVM tuning, we should note that there are various vendors available in the market for JVM. Based on the application requirement, we should select the JDK from the vendor.
Note
Sun JDK is widely used in the IT industries.
Why do we need to tune the JDK for Tomcat?
Tomcat 7 comes with a heap size of 256 MB. Applications today need a large memory to run. In order to run the application, we have to tune the JVM parameter for Tomcat 7. Let's quickly discuss the default JVM configurations for Tomcat. The following steps describe the method to find out the Tomcat Process ID (PID) and memory values as shown in the next screenshot:
Run the following command on the terminal in Linux:
ps -ef |grep java
This will return all the Java processes running in the system, with all information such as the PID, where Tomcat is running, and so on:
root 4306 1 0 14:09 pts/1 00:00:04 /opt/jdk1.6.0_24/bin/java -Djava.util.logging.config.file=/opt/apache- tomcat-7.0.12/conf/logging.properties...