JVM内存不足导致进程死掉. Native memory allocation (mmap) failed to map
一台服务器上部署很多JAVA进程已经是微服务的常态,但也有些坑。
背景,测试服务器上的一些JAVA进程突然挂掉,查看call back的日志发现如下:
# There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 1786867712 bytes for committing reserved memory. # 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 (os_linux.cpp:2673), pid=28610, tid=139813184919296 #