如何设置一个很大的JVM堆大小? [英] How to set up a really big JVM heap size?

查看:680
本文介绍了如何设置一个很大的JVM堆大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据JVM 6文档,默认情况下,服务器类计算机接收的初始堆大小为1/4 RAM或1GB.考虑到我们的Solaris 64Bit服务器具有64 GB,初始堆大小默认为256MB.因此,我需要使用XMX参数手动设置4GB的堆大小.但是,当我添加"-Xmx4096M"时,Tomcat无法启动.这是错误消息:

According to the JVM 6 documentation, server class machines receive by default an initial heap size as 1/4 RAM or 1GB. Considering our Solaris 64Bit server has 64 GB, the initial heap size will default in as 256MB. Therefore, I need to set manually the heap size using the XMX parameter for 4GB. Though, when I add "-Xmx4096M", Tomcat does not start. Here is the error message:

Invalid maximum heap size: -Xmx4096M
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

我的命令行参数应该允许我的堆增长到4GB?

What should be my command line parameters to allow my heap to grow up to 4GB?

推荐答案

谢谢大家的投入!但是,我的java -version的输出提到了mixed mode,这意味着它是64位.真正的解决方案是添加-d64以强制它以64位运行,并因此分配4GB.

Thanks for all your input, guys! Though, the output of my java -version mentions mixed mode which means that it is 64 bits. The real solution is adding -d64 to force it to run in 64 bits and therefore allocate the 4GBs.

这篇关于如何设置一个很大的JVM堆大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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