Eclipse内存分配问题 [英] Eclipse memory allocation problem

查看:133
本文介绍了Eclipse内存分配问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试分析〜800mb的堆转储,它需要比我的日食标准更大的堆.但是,当我转到eclipse.ini文件并设置-Xmx2g(或-Xmx2048m)时,出现错误无法创建Java虚拟机".

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)是的,我有足够的内存. 2)我可以将其更改为恰好为-Xmx976m. 3)我已经尝试过独立的MAT分析器,它可以与-Xmx1024m一起使用,而不是多一个字节. 4)不,1GB不足以分析该堆,我得到一个OOM

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

这是日食错误:

这是MAT错误:

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

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

我当前的eclipse.ini(正在运行)是:

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

有人知道吗?

谢谢!

f.

推荐答案

我创建了一个伪造的应用程序来测试jvm参数,我发现JVM似乎没有在Windows中交换,至少没有形式启动. 我有4gb的ram,但它只允许我分配剩余的可用空间.奇怪的是,对于不同的app来说,它的工作方式是不同的:我的假应用程序允许我提升到Xmx1380m,而eclipse仅提高到Xmx1024m.

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.

错误如下:

$ 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和应用程序运行正常.

Same thing but -Xmx1380g and the app went fine.

在Unix中从来没有这个问题,即使您直接交换,堆也将以您说的大小开始.

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

对于在Windows上有此问题的任何人: 首先检查ctrl + shift + esc->性能->物理内存;并将您的Xmx设置为与可用"中所示的值几乎相同.

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'.

如果有人能告诉您如何阻止JVM在启动之前检查您是否真的有足够的可用内存,那将是很酷的事情.我正在使用的1.5g在处理仅800mb的堆转储时起作用,但是如果它更大一点,我将无处运行...

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...

欢呼

f.

这篇关于Eclipse内存分配问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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