In the Infrax FAQ, Allen rote:

Whenever a JSP is installed or modified, and accessed for the first time, Tomcat munges it into a servlet .java source file in /usr/local/tomcat/work/localhost_8080%2Fgsrc and compiles it into a .class file in the same directory. When existing JSP's are modified, Tomcat doesn't delete the old versions of their .java files. Instead, it names them with incrementally increasing nubmers in their names. This goes on forever, filling up the directory with old useless stuff unless something comes along to clean things up.

A www cronjob does this cleanup. There's a line in www's crontab that runs a script in the above directory called cleanup_servlets The source code for the script is maintained under CVS in javapages/util the makefile there installs it into its home.

cleanup_servlets can take a "-n #", where "#" is the number of most recent versions of each servlet to keep. The default is 1.