无法使用-Xmx>运行java 966米 [英] Unable to run java with -Xmx > 966m

查看:159
本文介绍了无法使用-Xmx>运行java 966米的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将Xmx设置为967或更高的值,我将无法运行java。

i am unable to run java if i set Xmx to 967 or a higher value.


C:\Documents and Settings \\ \\ _salesforce> java -Xmx967m -version在初始化VM期间发生错误
无法为对象堆保留足够的空间
错误:无法创建Java虚拟机。
错误:发生致命异常。程序将退出。

C:\Documents and Settings\salesforce>java -Xmx967m -version Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

如果我运行相同的命令但将Xmx设置为966则运行正确:

If i run the same command but setting Xmx to 966 it runs correctly:


C:\Documents and Settings \salesforce> java -Xmx966m -version java
version1.7.0_25Java(TM)SE Runtime Environment(build
1.7.0_25-b17)Java HotSpot(TM)客户端VM(版本23.25-b01,混合模式)

C:\Documents and Settings\salesforce>java -Xmx966m -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b17) Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)

之前执行命令3GB的ram可用(任务管理员)。

Before executing the command 3GB of ram are available (task manager).

环境:


  • Java 1.7.0_25 32bits

  • Windows server 2003 SP2,4GB RAM

谢谢

推荐答案

JVM使用的不仅仅是内部的堆大小。根据您配置的内容(perm空间,线程堆栈大小,线程数等),这可能很容易占到几百MB。您使用的是32位jvm,因此在Windows 32位上最大进程大小为2GB,我相信。我相信有办法将其扩展到3GB(例如 http://dwf.blogs.com/beyond_the_paper/2009/04/enabling-3gb-switch-on-windows-vista.html 对此有一些解释);但是因为我在那种环境中已经有一段时间了。所以你可能接近极限。

The JVM uses a bit more than just the heap size for internals. That may easily account for a few hundred MB depending on how you configured things (perm space, thread stack size, number of threads, etc.). You are using the 32 bit jvm so the max process size would be 2GB on windows 32 bit, I believe. I believe there are ways to expand that to 3GB (e.g. http://dwf.blogs.com/beyond_the_paper/2009/04/enabling-3gb-switch-on-windows-vista.html has some explanation on this) ; but it's been a while since I was in that kind of environment. So you are probably running close to the limit.

这篇关于无法使用-Xmx>运行java 966米的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆