4

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?

Grant Zhu
  • 2,988
  • 2
  • 23
  • 28

4 Answers4

6

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.
RRM
  • 2,495
  • 29
  • 46
2

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

Grant Zhu
  • 2,988
  • 2
  • 23
  • 28
1

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

blue2993
  • 11
  • 1
1

-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

Mariano Paniga
  • 626
  • 12
  • 26