简体   繁体   中英

Reload Tomcat webapp automatically?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM