- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我在尝试将 -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
评论 line out jetty 将毫无问题地开始。但是,由于系统内存泄漏,我们确实需要添加此参数,以防止我们的进程崩溃时进一步损坏。
有人知道我在这里做错了什么或如何解决这个问题吗?
最佳答案
在 Java 版本 8u92 中,VM 参数
-XX:+ExitOnOutOfMemoryError
-XX:+CrashOnOutOfMemoryError
已添加,请参阅 release notes .
ExitOnOutOfMemoryError
When you enable this option, the JVM exits on the first occurrence of an out-of-memory error. It can be used if you prefer restarting an instance of the JVM rather than handling out of memory errors.CrashOnOutOfMemoryError
If this option is enabled, when an out-of-memory error occurs, the JVM crashes and produces text and binary crash files.
增强请求:JDK-8138745 (参数命名错误虽然 JDK-8154713 , ExitOnOutOfMemoryError
而不是 ExitOnOutOfMemory
)
关于java - -XX :OnOutOfMemoryError ="kill -9 %p" Problem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5792049/
一个观察:当我在 android 上开发我的应用程序时,我注意到 LogCat 中有以下两行。这些发生是因为我自己的应用程序的内存需求太多。我读过 Android 可以决定何时摆脱不需要或由于内存需求
SIGINT有什么区别信号和 SIGTERM信号?我知道SIGINT相当于在键盘上按Ctrl+C,但什么是SIGTERM为了?如果我想优雅地停止一些后台进程,我应该使用哪些? 最佳答案 响应的唯一区别
假设我有一个父进程和一个子进程(以例如 fork() 或 clone() 启动)在 Linux 上运行。进一步假设存在一些父子都可以修改的共享内存。 在父进程的上下文中,我想停止子进程并知道它实际上已
所以我最近了解到 kill is not a synchronous命令,所以我在 bash 中使用这个 while 循环,这很棒: while kill PID_OF_THE_PROCESS 2>/
我遇到了一个问题。我们有一个干净的脚本用来清理旧文件,有时我们需要停止它,稍后再启动它。像下面的过程。我们在check.sh中使用kill -STOP $pid和kill -CONT $pid来控制c
内核中谁负责终止进程。 如果“kill”来了,进程处于阻塞状态怎么办。 kill是否等到进程进入running状态才清理自己。 如果有人可以在内核方面回答更多问题,例如当 kill 命令生成 SIGI
在下面的链接中 http://www.faqs.org/docs/Linux-HOWTO/NFS-HOWTO.html 它说一个进程除非被“sure kill”才能杀死,但是什么是sure kill?
我正在尝试编写一个快速的 bash 脚本,以在脚本检测到的特定条件下向程序发出信号,并且出于习惯,我正在使用某些 bin 实用程序的完整路径,即 /bin/rm 和 /bin/kill 代替 rm 和
我的服务器在端口 80 上运行 nohup。我试试 ps aux | grep nohup 得到 root 9234 0.0 0.1 11740 932 pts/1 S+ 15:19 0:00 gre
我写了下面的脚本,如果 grep 在文件中找不到相关的字符串,它会启用 20 秒的超时。 脚本运行良好,但是脚本的输出是这样的: ./test: line 11: 30039: Killed 如何从
基本上我想要一个 bash 脚本进程,在收到 SIGINT 后,在退出之前杀死它的所有子进程。我读了here使用以下内容: trap "kill -TERM -$$ ; exit 1" INT QUI
我有一个名为 Launcher.sh 的 shell 脚本,它由 java 进程执行。 java进程内部使用ProcessBuilder来执行bash脚本。 在 Launcher.sh 中,我有以下代
上下文 我创建了一个调用 celery 任务的 Django 应用程序,该任务又会生成其他任务并等待它们完成。 工作流程如下: 1) 主要的python/django代码在后台启动一个celery任务
我要输出这条消息/usr/local/ex1.sh: line xxx: Killed ex2.sh >> $LOG_FILE 2>&1到日志文件。 不过 “ex1.sh”输出 /usr/local
我最近上传了很多问题,我认为人们对我感到厌倦,但我不擅长编程,并且正在尝试为 A-level 类(class)编写游戏代码,所以我需要所有可以得到的帮助来学习语言。不管怎样,我将在下面展示一些相关的代
hadoop job -kill job_id 和 yarn application -kill application_id 有什么区别? job_id 和 application_id 是否代表/
在我的 post-command-hook回调,当我这样做时 kill-word , this-command var 是 kill-region - 而不是 kill-word正如预期的那样。 我想
我有一个要在 Oracle Linux OS 上运行的 C++ 应用程序。 考虑一下,我用 new 创建了几个对象。运算符(operator)。虽然我已经使用 delete 操作符来解除分配它,但是
不确定是否相关,但在周末我将我的操作系统升级到 Big Sur 11.1 版,然后当我开始工作时,一件又一件地出错,现在我根本无法使用 node 或 npm。我在 zsh 中收到以下消息: % nod
我使用 python 并行启动两个子进程。一个是 HTTP 服务器,而另一个是另一个程序的执行(CustomSimpleHTTPServer.py,它是由 selenium IDE 插件生成的 pyt
我是一名优秀的程序员,十分优秀!