Search code examples
tomcatdirectorytemp

Clarifications on Tomcat's "temp" and "work" directories


I have been using Tomcat for quite a while now but I am not sure what the

  • "temp" and
  • "work"

directories are used for and when I need to clean which.

Can anyone please advise?


Solution

    • work stores compiled JSPs and other assets.
      => You only need to "clean" the webapp directories under it on the rare occasions when an update to a WebApp is not picked up.

    • temp is used to store files created using the Java File API for creating temporary files.
      => You can "clean" it every time you restart Tomcat. If it is getting too full then one of your WebApps may have some form of leak where its not releasing temp files when its done with them (although it could just be under higher load too).