“Java运行时环境的内存不足”消息在日食 [英] "insufficient memory for the Java Runtime Environment " message in eclipse

查看:1289
本文介绍了“Java运行时环境的内存不足”消息在日食的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Eclipse中运行Java代码时,我收到以下消息:

When I run my Java code in Eclipse, I get the following message:

There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (malloc) failed to allocate 4088 bytes for AllocateHeap
An error report file with more information is saved as:
E:\Eclipse_Workspace\BTest\hs_err_pid1888.log

我的电脑里有4GB的内存我也将我的JRE从1.7改为1.8。但这个问题似乎没有解决。我使用带有i3处理器的Win 8系统,C盘中有大约20gb的可用磁盘空间。

I have 4GB RAM in my computer. I have changed my JRE from 1.7 to 1.8 too. But the issue seems un-resolved. I use a Win 8 system with i3 Processor and have around 20gb of free disk space in my C Drive.

Eclipse版本:Eclipse Juno Service release 2

Eclipse version: Eclipse Juno Service release 2

我也在启动Eclipse时收到此消息。

I also get this message while starting Eclipse. I have attached the error message screen shot.

导致这个问题的原因是什么?

What is causing this issue?

eclipse.ini中的内存参数file:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-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
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

解决方案:
重新安装eclipse修复问题。

Resolution: Re-installing eclipse fixed the problem.

推荐答案

上面的消息表示您在PC上运行了这么多程序,没有任何内存可以再运行一次。这不是一个Java问题,没有Java选项会改变这个。

The message above means that you're running so many programs on your PC that there is no memory left to run one more. This isn't a Java problem and no Java option is going to change this.

使用Windows的任务管理器查看你的4GB内存实际上是多少>自由即可。我的猜测是,某处,你有一个程序,可以吃掉所有的记忆。找到它并杀死它。

Use the Task Manager of Windows to see how much of your 4GB RAM is actually free. My guess is that somewhere, you have a program that eats all the memory. Find it and kill it.

编辑您需要了解有两种类型的内存不足错误。

EDIT You need to understand that there are two types of "out of memory" errors.

第一个是在运行Java代码并且Java 不够大时可以获得的OutOfMemoryException。这意味着Java 代码要求Java 运行时用于内存。您可以使用 -Xmx ...

The first one is the OutOfMemoryException which you get when Java code is running and the Java heap is not large enough. This means Java code asks the Java runtime for memory. You can fix those with -Xmx...

修复这些错误另一个错误是当Java 运行时内存不足。这与所有上的Java堆无关。这是一个错误,当Java要求操作系统更多的内存和操作系统说:对不起,我没有任何。

The other error is when the Java runtime runs out of memory. This isn't related to the Java heap at all. This is an error when Java asks the OS for more memory and the OS says: "Sorry, I don't have any."

要修复后者,关闭应用程序或重新启动(清理内存碎片)。

To fix the latter, close applications or reboot (to clean up memory fragmentation).

这篇关于“Java运行时环境的内存不足”消息在日食的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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