2

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?

user32262
  • 8,660
  • 21
  • 64
  • 77

1 Answers1

4

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

Java memory leak

When log shows a lot of GC hits, what code change shall we need?

Ways to reduce memory churn

Community
  • 1
  • 1
JoseK
  • 31,141
  • 14
  • 104
  • 131
  • 1
    Points for mentioning that the problem is to be solved somewhere else. Keeping reloading it makes no sense. – BalusC Aug 05 '10 at 11:38