zoukankan      html  css  js  c++  java
  • java.lang.OutOfMemoryError: unable to create new native thread

    tomcat的web项目压力测试时,测试了几秒钟,web服务开始无响应。tomcat的日志中看到如下错误:

    java.lang.OutOfMemoryError: unable to create new native thread

    查了以下该process开启的线程数为3366

    $ pstree -p 22750 | wc -l
    3366

    而此时内存消耗量并不大,然后又用 ulimit -a查看了各个限制,发现 max user processes 才4096。

    然后修改 /etc/security/limits.conf ,下方添加以下内容(webadmin是启动tomcat的用户):

    root        -       nofile  655360
    root        -       nproc   655360
    webadmin        -       nofile  409600
    webadmin        -       nproc   409600

    然后再看ulimit,就没问题了

  • 相关阅读:
    11.2
    11.1
    10.31JS中级
    10.24
    动画运动
    操作js的样式
    js
    js元素属性
    js轮播
    js计时器
  • 原文地址:https://www.cnblogs.com/got-my-way/p/8016183.html
Copyright © 2011-2022 走看看