[转]failed to create the java virtual machine
failed to create the java virtual machine
原文地址:http://blog.sina.com.cn/s/blog_740ccd040101ozpc.html启动eclipse或者hitool时可能会遇到这样的错误
failed to create the java virtual machine
解决办法如下(以hitool为例):
修改对应的ini配置文件:
原来的ini文件如下:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-vmargs
-Xverify:none
-Xms40m
-Xmx64m
-XX:PermSize=40m
-XX:MaxPermSize=64m
-Xnoclassgc
-XX:CMSInitiatingOccupancyFraction=85
-XX:DefaultMaxRAMFraction=1
-XX:+UseParallelGC
-XX:NewRatio=8
-XX:SurvivorRatio=8
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=31
-XX:+UseBiasedLocking
-XX:CompileCommand=quiet
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,java/text/SimpleDateFormat,subParseZoneString
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-vmargs
-Xverify:none
-Xms40m
-Xmx64m
-XX:PermSize=40m
-XX:MaxPermSize=64m
-Xnoclassgc
-XX:CMSInitiatingOccupancyFraction=85
-XX:DefaultMaxRAMFraction=1
-XX:+UseParallelGC
-XX:NewRatio=8
-XX:SurvivorRatio=8
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=31
-XX:+UseBiasedLocking
-XX:CompileCommand=quiet
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,java/text/SimpleDateFormat,subParseZoneString
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,
修改成如下:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-vmC:\Program Files (x86)\Java\jdk1.8.0_05\bin\javaw.exe
-Xverify:none
-Xms40m
-Xmx64m
-XX:PermSize=40m
-XX:MaxPermSize=64m
-Xnoclassgc
-XX:CMSInitiatingOccupancyFraction=85
-XX:DefaultMaxRAMFraction=1
-XX:+UseParallelGC
-XX:NewRatio=8
-XX:SurvivorRatio=8
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=31
-XX:+UseBiasedLocking
-XX:CompileCommand=quiet
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,java/text/SimpleDateFormat,subParseZoneString
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-vmC:\Program Files (x86)\Java\jdk1.8.0_05\bin\javaw.exe
-Xverify:none
-Xms40m
-Xmx64m
-XX:PermSize=40m
-XX:MaxPermSize=64m
-Xnoclassgc
-XX:CMSInitiatingOccupancyFraction=85
-XX:DefaultMaxRAMFraction=1
-XX:+UseParallelGC
-XX:NewRatio=8
-XX:SurvivorRatio=8
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=31
-XX:+UseBiasedLocking
-XX:CompileCommand=quiet
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,java/text/SimpleDateFormat,subParseZoneString
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,
-vmargs:说明后面是VM的参数
-Xms40m:虚拟机占用系统的最小内存
-Xmx256m:虚拟机占用系统的最大内存
-XX:PermSize:最小堆大小。一般报内存不足时,都是说这个太小,
堆空间剩余小于5%就会警告,建议把这个稍微设
大一点,不过要视自己机器内存大小来设置
-XX:MaxPermSize:最大堆大小。这个也适当大些
-Xmx512M的5%为25.6M,理论上要求-Xmx的数值与-XX:MaxPermSize必须大于25.6M
其实你跑程序这配置内存应该够用了,之所以会内存溢出,你查一下是不是调试时程序没正常停掉,任务管理器里有多个java进程导致的