当我在Eclipse中运行我的Java代码时,我收到以下消息:
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
Run Code Online (Sandbox Code Playgroud)
我的电脑里有4GB内存.我也将我的JRE从1.7改为1.8.但这个问题似乎没有得到解决.我使用带有i3处理器的Win 8系统,在我的C盘中有大约20GB的可用磁盘空间.
Eclipse版本:Eclipse Juno Service版本2
我在启动Eclipse时也收到此消息.我已附上错误消息屏幕截图.
是什么导致了这个问题?

"eclipse.ini"文件中的内存参数:
-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
Run Code Online (Sandbox Code Playgroud)
解决方法: 重新安装eclipse修复了这个问题.