Linux (SL4) 上定义的默认 JVM 堆大小在哪里
我目前在 SL4 集群上使用 sun 的 java 1.6。
由于某种原因,1.6 JVM 启动时使用了一个难以置信的大堆,并且无法启动:
java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
如果我使用例如 -Xmx1800M 启动它,那么它可以正常工作。所以,我想知道默认堆大小在哪里设置,更重要的是如何更改它?
该机器有8GB物理内存,我相信sun的服务器JVM应该以默认的一半内存启动,最多512M,但事实显然不是这样,因为它试图分配超过1800M。
编辑:我意识到可以使用 _JAVA_OPTIONS,但这感觉有点笨拙;我期待在某个地方有一个属性文件,但到目前为止我一直找不到它。
I'm currently using sun's java 1.6 on a SL4 cluster.
For some reason, the 1.6 JVM is starting up with an impossibly large heap, and cannot start:
java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
If I start it with e.g. -Xmx1800M, then it works OK. So, I'm wondering where the default heap size is set, and more importantly how to change it?
The machine has 8GB of physical memory, and I believe that sun's server JVM is supposed to start with a default of half the memory up to 512M, but this is clearly not the case, as it's trying to allocate over 1800M.
EDIT: I realise that it's possible to use _JAVA_OPTIONS, but this feels a bit clunky; I was expecting a properties file somewhere, but so far I've been unable to find it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有为此的属性文件。根据垃圾收集器人体工程学:
假设您有 8GB RAM,假设您使用的是 Java 6,默认最大堆大小应为 1GB。
There is no properties file for this. According to Garbage Collector Ergonomics:
Given you have 8GB of RAM, default maximum heap size should be 1GB assuming you're using Java 6.
没有标准属性文件。 (Sun) JVM 中硬编码了默认值。
There's no standard properties file. The (Sun) JVM has the default values hardcoded in it.