Error occurred during initialization of VM Could not reserve enough space for object heap
2016-10-08 14:38
537 查看
今天在启动eclipse项目时突然报下面错误:
Error occurred during initialization of VM Could not reserve enough space for object heap
机器配置是 Win7 64bit, CPU 3.2GHZ X2, 4G内存。于是跟他要了tomcat的启动参数,如图:
[b] 问题分析[/b]
根据错误信息得知是VM在初始化的时候发生错误,原因是不能为对象分配足够的空间。
系统本身需要1G+的内存,上图中分配给tomcat的初始参数为1G,(因为公司项目比较大,需要比较大的内存开销。虚拟机会在堆空间使用70%的时候扩充到最大空间,即-Xmx的值:3G),如图中参数所示tomcat启动分配了512m持久代空间;
其次是eclipse启动本身也是一个JVM实例,分配了1G堆空间,持久带也有512M的开销,
这样算下来远远超出了物理机的承受范围,所以出现如上错误。
[b] 解决方案[/b]
1、把tomcat的参数去掉或者减小参数值,建议控制在1024M之内,持久代设置为256M完全够用,如果系统用到了大量的反射、动态代理或者字节码增强功能可以适当增大持久代,因为这些功能对持久代的开销是比较大的。
2、找到eclipse.ini,将-Xms1024m -Xmx1024m 这两个参数设置为相同的值可以避免JVM动态扩充带来的影响。eclipse的-XX:MaxPermSize=512m 参数控制在512M。
重新启动,问题解决。
注意:一定要重启eclipse!!
Error occurred during initialization of VM Could not reserve enough space for object heap
[b] 硬件配置[/b]
机器配置是 Win7 64bit, CPU 3.2GHZ X2, 4G内存。于是跟他要了tomcat的启动参数,如图:
[b] 问题分析[/b]
根据错误信息得知是VM在初始化的时候发生错误,原因是不能为对象分配足够的空间。
系统本身需要1G+的内存,上图中分配给tomcat的初始参数为1G,(因为公司项目比较大,需要比较大的内存开销。虚拟机会在堆空间使用70%的时候扩充到最大空间,即-Xmx的值:3G),如图中参数所示tomcat启动分配了512m持久代空间;
其次是eclipse启动本身也是一个JVM实例,分配了1G堆空间,持久带也有512M的开销,
这样算下来远远超出了物理机的承受范围,所以出现如上错误。
[b] 解决方案[/b]
1、把tomcat的参数去掉或者减小参数值,建议控制在1024M之内,持久代设置为256M完全够用,如果系统用到了大量的反射、动态代理或者字节码增强功能可以适当增大持久代,因为这些功能对持久代的开销是比较大的。
2、找到eclipse.ini,将-Xms1024m -Xmx1024m 这两个参数设置为相同的值可以避免JVM动态扩充带来的影响。eclipse的-XX:MaxPermSize=512m 参数控制在512M。
重新启动,问题解决。
注意:一定要重启eclipse!!
相关文章推荐
- ant build Error occurred during initialization of VM Could not reserve enough space for object heap
- android Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.
- Error occurred during initialization of VM Could not reserve enough space for object heap
- Error occurred during initialization of VM Could not reserve enough space for object heap Could not
- 问题3-Error occurred during initialization of VM Could not reserve enough space for object heap
- Error occurred during initialization of VM Could not reserve enough space for object heap
- Error occurred during initialization of VM Could not reserve enough space for object heap
- tomcat Error occurred during initialization of VM Could not reserve enough space for ?KB object heap
- Error occurred during initialization of VM Could not reserve enough space for object heap
- fisheye Error occurred during initialization of VM Could not reserve enough space for object heap 问题解决!
- Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap
- AndroidStudio启动错误:Error occurred during initialization of VM Could not reserve enough space for ...
- Error occurred during initialization of VM; Could not reserve enough space for 1572864KB object heap
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- android studio 的 Error occurred during initialization of VM Could not reserve enough space fo 解决办法
- Windows下ElasticSearch安装中的问题解决-Error occurred during initialization of VM Could not reserve enough sp
- JVM启动报错: Could not reserve enough space for object heap error