簡體   English   中英

調試onoutofmemory無法啟動tomcat

[英]debug onoutofmemory unable to start tomcat

我可以選擇在內存不足時重新啟動tomcat。

-XX:OnOutOfMemoryError=/opt/tomcat/bin/restart.sh

這是restart.sh

#!/bin/bash

pkill -9 -f tomcat
/opt/tomcat/bin/startup.sh

Tomcat執行腳本,殺死tomcat,但不再重新啟動。 這是日志

java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError="/opt/tomcat/bin/restart.sh"
#   Executing /bin/sh -c "/opt/tomcat/bin/restart.sh"...

請幫助我調試為什么tomcat無法重新啟動。

我沒有找到此問題的答案,但最終我每隔2分鍾對tomcat進行一次運行狀況檢查,這解決了我在內存不足時手動重新啟動tomcat的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM