Is it possible to configure web.xml to reload a specific tomcat webapp at a particular time automatically. If not, is it possible to do this programatically?
+3
A:
Programatically - an option is to write an Ant script for reload the webapp you want based on the example given on the Tomcat docs
So you'll be left with a command like
ant -Dpassword=secret reload
and put this into a cron tab on your server (if Unix/Linux) or Windows Task Scheduler for windows.
I notice you've tagged your question garbage-collection
. If you are redeploying the web app due to excessive GC, then its better to tackle the root cause of the issue since this reload is only a workaround.
Run a profiler to identify memory leaks.
Related Reading on Memory Issues / GC
http://stackoverflow.com/questions/1638011/java-memory-leak
http://stackoverflow.com/questions/3077154/ways-to-reduce-memory-churn/3077857#3077857
JoseK
2010-08-05 06:32:02
Points for mentioning that the problem is to be solved somewhere else. Keeping reloading it makes no sense.
BalusC
2010-08-05 11:38:58