最近在测试使用此参数的效果时,发现此参数无效。报错信息如下:
[hadoop@slave8 ~]$ java -Xms:1536m -Xmx:1536m -Xns:128m -XgcPrio:pausetime -XXexitOnOutOfMemory
Unknown option or illegal argument: -XXexitOnOutOfMemory.
Please check for incorrect spelling or review documentation of startup options.
Could not create the Java virtual machine.
但是在官方文档里,确实也有此参数,而且关于此参数的使用介绍也很简单,如下:
-XXexitOnOutOfMemory
This option makes JRockit JVM exit on the first occurrence of an out of memory error. It can be used if you prefer restarting an instance of JRockit JVM rather than handling out of memory errors.
Operation
Format: -XXexitOnOutOfMemory
Enter this command at startup to force JRockit JVM to exit on the first occurrence of an out of memory error
Flags or Other Options Affected
None
Exceptions
None
问题原因是版本过低,新版本的R28参考文档地址:
http://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionxx.htm#BABCDAIB