Is there a technique for loading JSP / servlet files into memory so that they are available quickly to users?

Ryan Breidenbach

Your server container takes care of this for you. The container will manage this so that the most frequently accessed servlets are kept in memory (since memory resources are finite). And since JSPs are compiled into servlets, the same applies to them, as well. The only difference is that you may notice a lag the first time a JSP is accessed. This is simply the JSP being compiled into a servlet by the JSP engine. You can also additionally precompile JSPs into servlets under engines like Tomcat and Weblogic using a precompiler.

Having servlets in memory is actually one of the big advantages of using servlets over other technologies, such as CGI scripts, to create dynamic web content. Since servlets are in memory, the overhead of file I/O accociatated with CGI scripts is avoided, which creates more effecient web applications.