Linux(CentOS 7)tomcat 8起動エラー


サーバ:Centos 7,Tomcat 8,JDK 8
プロジェクト起動エラー:
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
#

   
ソリューション:JVMのメモリサイズを変更します.
 
LinuxでJVMメモリサイズを変更するには:
tomcatのbinの下にcatalinaを追加します.shでは、位置cygwin=false前.注意引用符は帯にして、赤いのは新しく追加したものです.
# 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