今天遇到一个问题,就是JENKINS在同时部署两个前端应用时会出现崩溃的现象。

排查过程如下

查看tomcat-jenkins/bin/hs_err_pid27127.log发现:

Out of Memory Error (os_linux.cpp:2640), pid=27127, tid=0x00007f9de215f700

linux上遇到tomcat报Out of Memory错误,导致jenkins崩溃的问题

提示说可能达到了32位的进程数上限,确认了系统和JAVA均为64位,内存和SWAP空间还比较充足。

于是查看当前的打开文件数:

lsof |wc -l 发现为:236358

lsof -u root |wc -l 为 6534,

ps -xH|wc -l 得知线程数为1274,

ps -ef|wc -l 进程数为181,

ulimit -u 查看最大进程数为63469,应该足够使用了。

ulimit -n 查看用户打开文件数限制为10001,猜测应该是设置小了。

 于是修改"/etc/security/limits.conf",设置root的默认打开数:

root soft nofile 278528
root hard nofile 278528

发现并没有立即全局生效,于是修改了/etc/profile

在文件最后加上了:ulimit -n 278528,ok,暂时解决了崩溃的问题。

通过端口查进程:lsof -i :8080,

通过PID查线程数:lsof -p PID|wc -l

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2021-12-26
  • 2021-09-15
  • 2022-12-23
  • 2021-07-02
  • 2021-04-19
猜你喜欢
  • 2021-05-30
  • 2021-06-29
  • 2021-11-20
  • 2021-09-08
  • 2021-10-25
  • 2021-08-13
相关资源
相似解决方案