Consider the following guidelines for improving servlet performance:
Increase the Java heap size to help garbage collection. The Java heap size can be adjusted by adjusting the values specified to the —Xms and —Xmx jvm- options in server.xml. For example, <jvm-options>-Xms128m-Xmx256m</jvm-options> sets the minimum Java heap size to 128 MB and 256 MB. For more information, see Sun Java System Web Server 7.0 Update 6 Administrator’s Guide.
For information on tuning the Garbage Collector see, Managing Memory and Garbage Collection in Sun Java System Web Server 7.0 Update 6 Performance Tuning, Sizing, and Scaling Guide.
Set the stack space if applications use deep recursion, or in any cases where very complex JSP pages are used.
You can set the stack space using set-thread-pool-prop wadm command. For example, $wadm set-thread-pool-prop [other args] stack-size=544288. For more information, see Sun Java System Web Server 7.0 Update 6 NSAPI Developer’s Guide.
Create servlet sessions only if required as the Session ID generator employs cryptographically unique random number generation algorithms. While sessions are being created, limit the size of sessions and configure them depending on whether the application uses short-lived or long-lived sessions. For more information on optimal session configuration, see Configuring the Web Application’s Session Settings in Sun Java System Web Server 7.0 Update 6 Performance Tuning, Sizing, and Scaling Guide.
Use servlet cache when possible. For more information, see Caching Servlet Results.
Use precompiled JSPs if the JSPs do not change after deployment to the Web Server. The precompiled JSPs should include the reload-interval property setting in the jsp-config element in sun-web.xml. This eliminates time-consuming compilation and periodic checking by the Web Server.
Reduce the number of directories in the classpath.
Disable dynamic reloading.
Disable the Java Security Manager.
For more information about maximizing servlet and JSP performance, see Tuning Java Web Application Performance in Sun Java System Web Server 7.0 Update 6 Performance Tuning, Sizing, and Scaling Guide.
For more information about container setting to maximize performance, see Tuning Web Container Within Web Server 7.0 in Sun Java System Web Server 7.0 Update 6 Performance Tuning, Sizing, and Scaling Guide.