JVM报错:
Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f3577abba91, pid=3756, tid=0x00007f3578ede700 # # JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops) # Problematic frame: # C [libresolv.so.2+0x7a91] __libc_res_nquery+0x1c1 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. ......
此错误具体表现为:server运行一段时间后,莫名停止运行,进程也不在了,同时在server目录下会出现hs_err_pid3756.log类似的JVM错误日志文件
这个问题出现的原因是由于Linux的运行应用程序的打开文件的最大数及最大进程数设置的相对较小
需要修改如下配置:
/etc/security/limits.conf
,在文件最后增加两行配置
* soft nofile 100001 * hard nofile 100002
设置完成保存,重新登录下用户,用如下命令测试下是否生效了,看是否输出100001
[root@VM-4-17-centos server]# ulimit -n 100001
重启下server