There is insufficient memory for the Java Runtime Environment to continue.apache
报错信息以下 :tomcat
#socket
# There is insufficient memory for the Java Runtime Environment to continue.spa
# Native memory allocation (malloc) failed to allocate 1293536 bytes for Chunk::neworm
# An error report file with more information is saved as:进程
# D:\Tools\Tomcat\apache-tomcat-8.0.26\bin\hs_err_pid9192.log内存
[error occurred during error reporting , id 0xc0000005]ci
Disconnected from the target VM, address: '127.0.0.1:49585', transport: 'socket'get
Tomcat默承认以使用的内存为128MB,对于访问数比较多、比较吃内存的应用来讲,这是不够的。咱们能够经过调整Java虚拟机的启动参数来增长Tomcat可以使用的内存。
下面就是众所周知的两个参数
-Xms<size> JVM初始化堆的大小
-Xmx<size> JVM堆的最大值
好比,我想设置初始内存大小为128M,最多占用1G,就是下面的设置:
-Xms128m
-Xmx1024m
在Linux/Unix下,能够经过在 {tomcat_dir}/bin/catalina.sh 中增长或修改 JAVA_OPTS 来达到:
JAVA_OPTS="-Xms128m -Xmx1024m"
在Windows的免安装版本,能够经过在 {tomcat_dir}/bin/catalina.bat 中增长或修改 JAVA_OPTS 来达到:
set JAVA_OPTS=-Xms128m -Xmx1024m
虚拟机
设置以后,查看进程管理挥发现,内存大小很接近Xmx这个值