特别做一下记录:
#
# 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
# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# 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=25027, tid=0x00007f18beedd700
#
# JRE version: (8.0_222-b10) (build )
# Java VM: OpenJDK 64-Bit Server VM (25.222-b10 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
#--------------- T H R E A D ---------------
Current thread (0x00007f18b804b800): JavaThread "Unknown thread" [_thread_in_vm, id=25028, stack(0x00007f18bedde000,0x00007f18beede000)]
Stack: [0x00007f18bedde000,0x00007f18beede000], sp=0x00007f18beedc7c0, free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xaced2d]
V [libjvm.so+0x4f44fa]
V [libjvm.so+0x5c5c7f]
V [libjvm.so+0x5c5457]
V [libjvm.so+0x8eb164]
V [libjvm.so+0xa979c9]
V [libjvm.so+0xa97c72]
V [libjvm.so+0x626545]
V [libjvm.so+0xa7aa0f]
V [libjvm.so+0x6a71bf] JNI_CreateJavaVM+0x5f
C [libjli.so+0x2f78]
C [libpthread.so.0+0x7dd5] start_thread+0xc5
--------------- P R O C E S S ---------------Java Threads: ( => current thread )
Other Threads:
=>0x00007f18b804b800 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=25028, stack(0x00007f18bedde000,0x00007f18beede000)]
VM state:not at safepoint (not fully initialized)
VM Mutex/Monitor currently owned by a thread: None
heap address: 0x0000000080200000, size: 30718 MB, Compressed Oops mode: Non-zero based:0x00000000801ff000, Oop shift amount: 3
Narrow klass base: 0x0000000000000000, Narrow klass shift: 0GC Heap History (0 events):
No eventsDeoptimization events (0 events):
No eventsClasses redefined (0 events):
No eventsInternal exceptions (0 events):
No eventsEvents (0 events):
No events
查看日志提示,java的虚拟内存不足, 网上查找问题
出现了JAVA 程序内存不够的问题,但经过测试后,发现内存及CPU空闲较多。
内存及CPU空闲较多,资源充足排除内存不足的影响,只能怀疑是哪里限制了最大线程数.
错误原因:
Linux是有文件句柄限制的,而且Linux默认不是很高,一般都是1024,生产服务器用其实很容易就达到这个数量。
也就是说普通用户有软硬件的限制。这不是授权就可以解除的。
另外一些恶意请求会把服务器给炸掉,要防止恶意请求,服务器要做限制,比如每秒钟限制请求数量。
参考博客:服务器外网访问很慢



