尝试将-XX:OnOutOfMemoryError =“kill -9%p”命令传递到我的jvm参数中有一个问题。
我正在使用Jetty7,并在start.ini文件中。在启动它给我以下错误。这是与jre /jre1.6.0_03l64
Starting Jetty: STARTED Jetty Tue Apr 26 09:54:26 EDT 2011
Unrecognized option: -9
Could not create the Java virtual machine.
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
评论出线码头将开始罚款没有问题。但是,由于系统内存泄漏,我们真的需要添加此参数,以防止在我们的进程崩溃时进一步损坏。
有人会有任何想法我在这里做错什么,或者我如何解决这个问题?