java无法在Windows服务器上保留堆大小错误

发布于 2024-08-24 15:43:07 字数 351 浏览 2 评论 0原文

你好,

我有以下配置: 服务器:Windows 2003 服务器(32 位) java 版本:1.5_0_22

从命令行执行时出现以下错误(我的代码基于 eclipse,但给出了相同的错误)

java -XX:MaxPermSize=256m -Xmx512m VM初始化期间发生错误 无法为对象堆保留足够的空间 无法创建 Java 虚拟机。

该服务器拥有超过 20GB 的物理内存,目前有超过 19GB 的可用空间。

它不会给出高达 -Xmx486m 的错误

我已经阅读了有关连续内存空间的其他文章。该服务器上几乎没有任何东西在运行。我可以以任何方式验证这一点吗?

谢谢

HI,

I have the following configuration:
Server : windows 2003 server (32 bit)
java version: 1.5_0_22

I get the following error when executing from command line ( my code is based off eclipse wihch gives the same error)

java -XX:MaxPermSize=256m -Xmx512m
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

The server has over 20GB physical memory with over 19 GB free right now.

It does not give an error upto -Xmx486m

I have read other articles about contiguous memory space. There is hardly anything running on this server. Can I validae this in any way?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

高冷爸爸 2024-08-31 15:43:07

如果你的内存是碎片化的,JVM将无法获得它所需要的连续内存。
尝试在重新启动后运行 java,您应该能够获得 1 GB 或更多空间。

使用 64 位操作系统和 JVM,就不会有这个问题。

作为比较,您尝试过 Java 6 吗?即使您无法使用 Java 6,这也有助于表明问题更有可能出现在操作系统中(如果 Java 6 也不起作用)还是 Java 5.0 中(如果 Java 6 有效),

因为 Java 5.0 不再免费支持,如果您需要 Java 5.0 支持,则必须付费。

If your memory is fragmented, the JVM will not be able to obtain the continous memory it needs.
Try running java after a fresh reboot and you should be able to get a 1 GB or more.

With a 64-bit OS and JVM you won't have this problem.

For comparison have you tried Java 6? Even if you cannot use Java 6 this would help indicate whether the problem is more likely to be in the OS (if Java 6 doesn't works either) or in Java 5.0 is (if Java 6 works)

As Java 5.0 is no longer freely supported, if you need support for Java 5.0 you will have to pay for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文