Tuning Just-In-Time compilers

Java virtual machines (JVM) use Just-In-Time (JIT) compilers to compile Java byte codes into native instructions during server run time. A JIT compiler is a platform-specific compiler that generates machine instructions for each method as needed. These compilers can affect startup or runtime performance.

About this task

By default, the size of the JIT codetotal parameter for the WebSphere Commerce JVM is 128 MB. Sometimes, this size might not be sufficient for your application. Once the JIT cache is full, the JIT compilers stop the optimization for compiling code. The stopping of this optimization can affect application performance. By monitoring the JIT compiler usage and tuning the JIT codetotal parameter, you can avoid this performance impact.

Procedure

  1. Configure the WebSphere Application Server settings to monitor the JIT compiler logs. By reviewing these log files, you can determine whether performance tuning is necessary.
    1. Open the WebSphere Application Server administrative console.
    2. Expand Servers > Server Types. Click WebSphere application servers. Click your server name.
    3. In the Server Infrastructure section, expand Java and Process Management. Click Process definition > Java Virtual Machine.
    4. In the Generic JVM arguments field, add the following parameter
      -Xjit:verbose,vlog=log_path
      Where log_path is the relative filepath location for the JIT compiler log file.
    5. Click Apply.
    6. Click Save directly to the master configuration.
    7. Restart the WebSphere Application Server.
    After you restart the server, run WebSphere Commerce for a duration. Monitor the JIT log that you specified in the log_path. If the line <WARNING: JIT CACHES FULL> exists in the log file, tune the JIT codetotal parameter.
  2. Tune the codetotal parameter. Increase the codetotal size by changing the JVM generic parameters.
    1. In the WebSphere Application Server administrative console, expand Servers > Server Types. Click WebSphere application servers. Click your server name.
    2. In the Server Infrastructure section, expand Java and Process Management. Click Process definition > Java Virtual Machine.
    3. In the Generic JVM arguments field, increase the value for the -Xjit:codetotal parameter.
      Note: Do not tune the JIT codetotal value to be larger than the size that is necessary. By increasing the value for the codetotal parameter too much, a negative performance impact can occur. You are recommended to set the value for the codetotal parameter to be only large enough to meet your application requirements.
    4. Click Apply.
    5. Click Save directly to the master configuration.
    6. Restart the WebSphere Application Server.
    Iterate this tuning process until the warning <WARNING: JIT CACHES FULL> no longer added to the JIT log file. When the JIT codetotal parameter is properly configured, disable the logging for the JIT compiler in the WebSphere Application administrative console. To disable this logging, remove the -Xjit:verbose,vloglog_path parameter from the Generic JVM arguments field.