翔子 发表于 2014-12-3 12:44:33

修改OS对线程的限制

java程序遇到: unable to create new native thread

在Linux操作系统设定nofile和nproc,具体编辑/etc/security/limits.conf添加如下:
soft    nofile          2048
   hard    nofile          8192

soft    nproc         2048
   hard    nproc         8192

如果使用Red Hat Enterprise Linux 6,编辑/etc/security/limits.d/90-nproc.conf,添加如下配置:
# cat /etc/security/limits.d/90-nproc.conf
    *          -    nproc      2048
    *          -   nofile      8192
    root   soft    nproc   unlimited
页: [1]
查看完整版本: 修改OS对线程的限制