我試圖將-XX:OnOutOfMemoryError="kill -9 %p"
命令傳遞給我的jvm參數時出現問題。-XX:OnOutOfMemoryError =「kill -9%p」問題
我正在使用Jetty7,並且在start.ini文件中有這個。在啓動它給我下面的錯誤。這是JRE /jre1.6.0_03l64
出發碼頭:已開始碼頭週二4月26日9點54分26秒EDT 2011
無法識別的選項:-9
無法創建Java虛擬機。
start.ini文件如下。
#===========================================================
# If the arguements in this file include JVM arguments
# (eg -Xmx512m) or JVM System properties (eg com.sun.???),
# then these will not take affect unless the --exec
# parameter is included or if the output from --dry-run
# is executed like:
# eval $(java -jar start.jar --dry-run)
#
# Below are some recommended options for Sun's JRE
#-----------------------------------------------------------
--exec
# -Dcom.sun.management.jmxremote
-Xmx4096m
-Xmn512m
-DLABEL=PROD_APP
-verbose:gc
-Xloggc:/export/opt/prod_app/logs/gc.log
-XX:OnOutOfMemoryError="kill -9 %p"
# -XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:+PrintTenuringDistribution
# -XX:+PrintCommandLineFlags
# -XX:+DisableExplicitGC
# -XX:+UseConcMarkSweepGC
# -XX:ParallelCMSThreads=2
# -XX:+CMSClassUnloadingEnabled
# -XX:+UseCMSCompactAtFullCollection
# -XX:CMSInitiatingOccupancyFraction=80
談到線路輸出碼頭將開始罰款,沒有問題。但是,由於系統內存泄漏,我們確實需要添加此參數,以防止進程崩潰時造成進一步損害。
有沒有人有任何想法我在這裏做錯了或如何解決這個問題?
我也有類似的問題,但它是在我自己的批處理/ bash文件中。可能jetty會在.ini文件中的所有內容中引用他自己的引號。你可以用單引號(')來代替? – 2011-04-27 08:43:00
我不知道爲什麼它不工作......它說'-XX:OnOutOfMemoryError =「; 」\t當首次拋出OutOfMemoryError時運行用戶定義的命令。 (在1.4.2更新12,6中介紹)'http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html –
eee
2011-04-27 11:00:29
這個問題的任何可行解決方案? – sorin 2012-07-26 17:03:27