3

I wonder if work and temp should generally be left to be manged by Tomcat or should I manually clear it from time to time?

In our specific case new versions of the applications are always enumerated with ## notation (e.g. app##123.war, a next one is app##124.war). So conflicts between versions should not happen. But old versions seem to be kept by Tomcat in work/Catalina/localhost.

Also note that - in our case - most heavy applications are always updated together. There are some tools (like jolokia) which are updated in a separate process.

So would there be any significant performance gain in manually removing old applications form Tomcat's cache dirs? Or maybe the server would start slower because of those other apps of which cache would be removed in the process?

Nux
  • 541
  • 3
  • 12
  • 21

1 Answers1

2

There will be no performance gain in clearing old app versions out of work and temp.

It is a good idea to clear them out when you upgrade Tomcat (even point release upgrades). On rare occasions (maybe 2-3 times in 10 years), Tomcat will change the code generation for JSPs in a way that is incompatible with previous versions. If you don't clear out the work directory, you may see strange errors.

Mark Thomas
  • 867
  • 5
  • 8
  • Thanks for that answer. So is it fair to summarize your answer to *"Yes, it is good practice."*? (I'm asking because I'm considering writing a wrapper script for Tomcat start that'll do just that. I don't like what you call "strange errors" either. And I couldn't find official documentation either.) – StackzOfZtuff Oct 29 '18 at 09:44
  • 1
    Yes, that is a fair summary. – Mark Thomas Oct 30 '18 at 08:54