• JVM报错:Failed to write core dump. Core dumps have been disabled.


    JVM报错:Failed to write core dump. Core dumps have been disabled.

    https://blog.csdn.net/chengyuqiang/article/details/101192730

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # SIGBUS (0x7) at pc=0x00007f9d3d100c50, pid=29904, tid=0x00007f9ca2bfb700
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_192-b12) (build 1.8.0_192-b12)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.192-b12 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C [libzip.so+0x11c50] newEntry.isra.4+0x60
    #
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # An error report file with more information is saved as:
    # /opt/apache-tomcat-8.5.35/hs_err_pid29904.log
    Compiled method (nm) 107233860 175 n 0 java.util.zip.ZipFile::getEntry (native)
    total in heap [0x00007f9d2916e050,0x00007f9d2916e3c0] = 880
    relocation [0x00007f9d2916e178,0x00007f9d2916e1c0] = 72
    main code [0x00007f9d2916e1c0,0x00007f9d2916e3c0] = 512
    #
    # 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.

    ______________________________________________________________________________________________________________


    网上提供的解决办法,尝试如下

    [root@elastic1 logs]# ulimit -c unlimited
    [root@elastic1 logs]# ulimit -c -l
    core file size (blocks, -c) unlimited
    max locked memory (kbytes, -l) 64
    [root@elastic1 logs]#  


    这里备注一下:该方法并未解决问题,希望这里不要对其他网友产生误解。

    下面一篇博文提供了解决思路
    https://www.cnblogs.com/songyuejie/p/11221381.html

    (

    默认情况下Linux服务起的core core file size设置为0,需要调整该参数,但是这个参数并不能 解决问题;

    问题的根本原因在于服务器的运行应用程序的打开文件的最大数及最大进程数设置的相对较小默认为4096

    需要修改如下配置:

    /etc/security/limits.conf

    * soft nofile 327680
    * hard nofile 327680

    )

    默认情况下Linux服务起的core core file size设置为0,需要调整该参数,但是这个参数并不能 解决问题;
    问题的根本原因在于服务器的运行应用程序的打开文件的最大数及最大进程数设置的相对较小默认为4096
    需要修改如下配置:
    /etc/security/limits.conf 

    ______________________________________________________________________________________________________________

     
     
     

    【Linux】修改 /etc/security/limits.conf 不生效办法 

    https://blog.csdn.net/zzddada/article/details/121701005

    我们使用CentOS系统,在部署新的服务经常会遇到 打开最大文件数限制 too many open files的警告,通常我们只需要修改/etc/security/limits.conf该文件,增加两行,重新登录下用户即可解决,如下:

    vim /etc/security/limits.conf

    * soft nofile 60000
    * hard nofile 65535
    如果想要更细的控制粒度,可以在/etc/security/limits.d/90-nproc.conf对指定的用户(以testuser为例)进行限制

    vim /etc/security/limits.d/90-nproc.conf

    testuser - nofile 4096 # '-' 代表soft及hard都这样进行设定
    nginx - nofile 4096
    但,当/etc/security/limits.conf修改后,任凭如何调整设置,甚至重启主机都没有生效,就要从以下几个点进行排查了:

    1、检查/etc/ssh/sshd_config 中UsePAM yes选项是否开启

    2、检查/etc/pam.d/system-auth 中是否存在session required pam_limits.so这一项

    3、检查/etc/pam.d/login 中是否将pam_limits.so文件被加入到启动文件中存在session required /lib64/security/pam_limits.so这一项

    解释(1、2):UsePAM yes选项开启后,表示启用pam模块,在/etc/pam.d/sshd中默认已存在一项session include password-auth配置,include表示需要password-auth模块需要通过认证,在/etc/pam.d/system-auth里还应该存在session required pam_limits.so这一项,表示使用/etc/security/limits.conf这个配置

    解释(3):要让limits.conf文件配置能够生效,必须将pam_limits.so模块文件加入到启动文件中,故应在/etc/pam.d/login配置文件中添加session required /lib64/security/pam_limits.so这一项

    排查后,重新登录用户 / 切换用户 就可以生效了 !
    如果还未生效就要逐个排查/etc/pam.d下相关连的文件是否将session required pam_limits.so这一下项注释或删除了 

  • 相关阅读:
    centos 卸载自带的apache
    静态方法绑定
    安装apc
    避免SSH连接因超时闲置断开
    svn使用安全问题
    接口类,和抽象类。
    function (规定参数必须为某个对象的实例)
    jquery 获取DIV边框的宽
    正则表达式(非捕获)
    Linux ftp服务器Proftp配置
  • 原文地址:https://www.cnblogs.com/kelelipeng/p/16571874.html
Copyright © 2020-2023  润新知