Can I auto restart tomcat jvm on out of memory exception

后端 未结 7 1639
北海茫月
北海茫月 2021-01-31 05:12

I know that this is not \"best practice\" but I would like to know if I can auto restart tomcat if my deployed app throws an outofmemory exception

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 05:45

    not easily, and definitely not through the JVM that just suffered the out of memory exception. Your best bet would be some combination of tomcat status monitor coupled with cron scripts or related scheduled system administrator scripts; something to check the status of the server and automatically stop and restart the service if it has failed.

提交回复
热议问题