Linux (CentOS7) tomcat8 startup error

Server: Centos7, Tomcat8, JDK8

Project startup error:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x000000077d800000, 362807296, 0) failed; error='Cannot allocate memory' (errno=12)

 

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 260046848 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:2640), pid=5542, tid=0x00007f1928b70700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode linux-amd64 compressed oops)
# Core dump written. Default location: /usr/local/apache-tomcat-8.5.30/core or core.5542
#

   

Solution: Modify the memory size of the JVM.

 

Modify the JVM memory size under Linux:

To be added in catalina.sh under the bin of tomcat, before the location cygwin=false. Note that the quotation marks should be put on, and the red ones are newly added.

# OS specific support. $var _must_ be set to either true or false.

export JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m"

cygwin=false

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325979654&siteId=291194637