Unrecognized VM option '+HeapDumpOnCtrlBreak'

我们两清 提交于 2019-12-21 21:29:32

问题


I'm using Jboss and I added -XX:+HeapDumpOnCtrlBreak option to JAVA_OPTS. But I got the error when starting Jboss:

Unrecognized VM option '+HeapDumpOnCtrlBreak'
Could not create the Java virtual machine.

I've searched on the net and it seems JDK 6 doesn't support this option so I changed to jdk1.5.0_09 but still got this error.

Does anyone know what's wrong?


回答1:


the option doesn't work even on JDK 1.7 update 25:

>>java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b16)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

>>java -XX:+HeapDumpOnCtrlBreak
Unrecognized VM option 'HeapDumpOnCtrlBreak'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.



回答2:


Alright, seems that I need Java SE release 5.0 update 14 or above.




回答3:


Changes in 1.4.2_21 http://www.oracle.com/technetwork/java/javase/documentation/overview-142120.html

  • 6321286 java serviceability Add -dump option to jmap so that a cooperative heap dump can be obtained from a running VM.
  • 6454676 java serviceability Need -XX:+HeapDumpOnCtrlBreak to trigger heap dump on ctrl-break or ctrl-\
  • 6608975 java serviceability HeapDumpPath option is ignored for dumps written by HeapDumpOnCtrlBreak functionality

Upgrade to Jdk 1.4.2_21+ can help us support this heap dump generation functionality




回答4:


-XX:+HeapDumpOnCtrlBreak in HotSpot JVM (by Sun/Oracle) is present in 1.4.2_12 or higher and 1.5.0_14 or higher. For JVMs 1.6, 1.7, 1.8 this option is no more present, but you can use the "jmap" tool (jmap.exe -dump:format=b,file=HeapDump.hprof)

In HP-UX JVM the option is present in versions 1.4.2_11 or higher, and 1.5.0_05 and higher. And in all later versions (1.6, 1.7).

For more infos see A searchable collection of JVM options - HeapDumpOnCtrlBreak



来源:https://stackoverflow.com/questions/9577342/unrecognized-vm-option-heapdumponctrlbreak

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!