Eclipse内存分配问题

发布于 2024-09-24 07:56:10 字数 985 浏览 3 评论 0原文

我正在尝试分析大约 800mb 的堆转储,这需要比我的 Eclipse 标准更大的堆。但是,当我转到 eclipse.ini 文件并设置 -Xmx2g (或 -Xmx2048m)时,我收到错误“无法创建 Java 虚拟机”。

1)是的,我有足够的内存。 2)我可以将其精确地更改为-Xmx976m。 3)我已经尝试过独立的 MAT 分析器,它可以与 -Xmx1024m 一起使用,不再多一个字节。 4) 不,1gb 不足以分析该堆,我得到 OOM

这是 eclipse 错误: alt text

这是 MAT 错误: alt text

(我认为它们是相同的,这只是为了让您可以看到 MAT 的示例)

我当前的 eclipse。 ini(工作)是:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m

有人解决这个问题了吗?

谢谢!

f.

I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a -Xmx2g (or -Xmx2048m) I get an error "Failed to create the Java Virtual Machine".

1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the standalone MAT analyser and it works with -Xmx1024m, not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM

This is the eclipse error:
alt text

This is the MAT error:
alt text

(I reckon they are the same, this is just so you can see an example with MAT)

My current eclipse.ini (working) is:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m

Anybody figures this out?

thanks!

f.

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

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

发布评论

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

评论(4

梦醒时光 2024-10-01 07:56:10

我认为您看到的这个问题是在 Windows 上吗?

我有同样的问题。读完你的问题后,我又出去挖掘了。我刚刚找到了解决我的问题的方法。如果是一样的话就试试吧。
在 Eclipse 或 MemoryAnalyzer ini 文件中,从 Xmx 选项中删除 -。然后我的 ini 文件就变得

-vmargs
Xmx1536m

像一个拥有更多内存的魅力一样。
感谢 Alex2308 在此线程中的评论 http://troyworks.com/blog/2008/06/08/eclipse-jvm-termerated-exit-code-1/comment-page-1/#comment-80


我之前的解决方案是获取一张 Linux Live 光盘。启动到 Linux,然后我可以毫无问题地在 MAT 中分配 2g。 (确保您获得适用于 Linux 的 MAT)

这不是最好的解决办法,但我在 MAT 论坛上找不到任何表明存在错误的内容。

This problem you are seeing is on windows I assume?

I had the same issue. After reading your problem I went out digging again. I just found a solution to my issue. If it is the same try it out.
In your Eclipse or MemoryAnalyzer ini file, remove the - fromthe Xmx option. My ini file then becomes

-vmargs
Xmx1536m

and now works like a charm with more memory.
Thanks to the comment by Alex2308 in this thread http://troyworks.com/blog/2008/06/08/eclipse-jvm-terminated-exit-code-1/comment-page-1/#comment-80


My previous solution was to get a Linux Live disc. boot to Linux and then I was able to allocated 2g in MAT without issue. (make sure you get MAT for Linux)

Not the best work around, but I could never find anyting on the MAT forums indicating a bug.

街角卖回忆 2024-10-01 07:56:10

您似乎使用的是 32 位虚拟机。 Java VM 尝试将其整个内存空间保留在单个块中,这意味着根据系统 DLL 的位置,它可能无法获得那么多内存。切换到 64 位虚拟机(这显然需要 64 位 CPU 和操作系统)应该可以解决这个问题。

It looks like you're on a 32-bit VM. The Java VM tries to reserve its entire memory space in a single block, which means that depending on whereabouts your system DLLs are located it might not be able to get that much memory. Switching to a 64-bit VM (which obviously requires a 64-bit CPU & OS) should fix that.

怎言笑 2024-10-01 07:56:10

您是否修改了 Java 控制面板中的 Java 运行时环境设置?通过在运行时参数栏中添加运行时参数,例如-Xmx3072m。

也许你可以在这里查看详细信息..

在 Windows 7 中增加 JVM

希望能帮助解决您的问题..

Have you modify the Java Runtime Environment setting in Java Control Panel? By adding Runtime parameter e.g -Xmx3072m in Runtime Parameter's column.

Maybe you can check the details here..

Increase JVM in Windows 7

Hope it's help to solve your problem..

因为看清所以看轻 2024-10-01 07:56:10

我创建了一个假应用程序来测试 jvm 参数,我发现 JVM 似乎不会在 Windows 中交换,至少不会在启动时交换。
我有 4GB 内存,但它只允许我分配剩余的可用空间。奇怪的是,对于不同的应用程序,它的工作方式有所不同:我的假应用程序允许我达到 Xmx1380m,而 eclipse 只能达到 Xmx1024m。

错误如下:

$ java -jar -Xmx1500m "C:\fakeapp.jar"
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

同样的事情,但 -Xmx1380g 并且应用程序运行良好。

在unix中从来没有遇到过这个问题,堆将以你所说的任何大小开始,即使它直接用于交换。

对于在 Windows 上遇到此问题的任何人:
首先检查 ctrl + shift + esc ->性能->物理记忆;并将 Xmx 设置为与“可用”中所示的值大致相同。

如果有人能告诉我们如何阻止 JVM 在启动之前检查是否确实有足够的可用内存,那就太酷了。我使用的 1.5g 可以工作,因为我正在处理只有 800mb 的堆转储,但如果它再大一点,我就无处可逃了……

干杯,

f。

I've created a fake app to test jvm params, and what I found is that the JVM don't seems to swap in windows, at least not form the startup.
I have 4gb of ram, but it only allows me to allocate the remaining free space. Odd how it works different for different appps: my fake app allowed my to go up to Xmx1380m while eclipse only went up to Xmx1024m.

The error goes like:

$ java -jar -Xmx1500m "C:\fakeapp.jar"
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Same thing but -Xmx1380g and the app went fine.

Never had this problem in unix, the heap will start with whatever the size you say even if it goes straight for swap.

For anyone with this problem on windows:
first check ctrl + shift + esc -> performance -> Physycal Memory; and set you Xmx just about the same value as shown in 'Available'.

It would be cool if someone could tell how prevent the JVM from checking if you really have enough free memory before starting. The 1.5g I'm using worked as I'm processing a heap dump of only 800mb, but if it was a little bit bigger I'd have no where to run...

cheers,

f.

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