无法将Java堆大小设置为大于1568 [英] Unable to set Java heap size larger than 1568

查看:136
本文介绍了无法将Java堆大小设置为大于1568的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行具有以下属性的服务器:

I am running a server with the following attributes:

Windows Server 2008 R2标准版 - 64位
4GB RAM

Windows Server 2008 R2 Standard - 64bit 4gb RAM

我正在尝试将应用程序的堆大小设置为3gb。我正在使用标志-Xmx3G -Xms3G。使用标志运行会导致以下错误:

I am trying to set the heap size to 3gb for an application. I am using the flags -Xmx3G -Xms3G. Running with the flags results in the following error:


VM初始化期间发生错误
无法为对象堆保留足够的空间
无法创建Java虚拟机。

Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.

我一直在玩设置以查看我的天花板是什么1568是我的天花板。我缺少什么?

I have been playing with the setting to see what my ceiling is and found that 1568 is my ceiling. What am I missing?

推荐答案

Java需要在启动时连续虚拟内存。在Windows上,32位应用程序在32位模拟环境中运行,因此您不会获得比32位操作系统更多的连续内存。 C.F.在Solaris上,你可以为32位Java获得超过3 GB的虚拟内存。

Java requires continuous virtual memory on startup. On windows, 32-bit application run in an 32-bit emulated environment so you don't get much more continuous memory than you would in a 32-bit OS. c.f. on Solaris you get over 3 GB virtual memory for 32-bit Java.

我建议你使用64位版本的Java,因为它会利用所有的内存你有。你仍然需要有空闲内存,但更大的地址空间不会受到碎片的影响。

I suggest you use the 64-bit version of Java as this will make use of all the memory you have. You still need to have free memory but the larger address space doesn't suffer from fragmentation.

BTW:堆空间只是所用内存的一部分,你需要内存用于共享库,直接内存,GUI组件等。

BTW: The heap space is only part of the memory used, you need memory for shared libraries, direct memory, GUI components etc.

这篇关于无法将Java堆大小设置为大于1568的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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