liunx服务器 java应用报错线程无法创建问题

问题秒速


#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (gcTaskThread.cpp:48), pid=110115, tid=0x00007fb42a71f740
#
# JRE version:  (8.0_144-b01) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

Memory: 4k page, physical 46439204k(13383804k free), swap 0k(0k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.144-b01) for linux-amd64 JRE (1.8.0_144-b01), built on Jul 21 2017 21:57:33 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

time: Mon Jun  3 13:52:56 2024
elapsed time: 0 seconds (0d 0h 0m 0s)

查询用户的当前使用线程数



ps aux | grep museum |awk '{print $2}' | xargs -n1 pstree -p | wc -l

查看liunx给用户设置的最大使用线程数


[museum@museum-dev middleware]$  ps -u museum -L | wc -l  
3963
[museum@museum-dev middleware]$ 

# 或者
[museum@museum-dev middleware]$ ulimit -u

得出结论线程不够用了;扩大用户的线程数

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

image

更新设置

# 使用 sysctl 命令:在一些情况下,你可能需要重新加载内核参数。你可以通过运行以下命令来重新加载所有参数:
bash
sudo sysctl --system

解决!!!!

posted on   白嫖老郭  阅读(15)  评论(0编辑  收藏  举报

编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2023-06-03 Springboot+actuator+prometheus+Grafana集成

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示