如何在Eclipse中增加Java应用程序的堆内存

时间:2013-08-07 07:51:09

标签: java eclipse out-of-memory

任何人都可以教我如何使用 -Xms1024m -Xmx1024m 等参数来增加堆大小? Program参数和VM参数有什么区别?

2 个答案:

答案 0 :(得分:5)

如果你去Run - >在参数选项卡中运行配置,您将找到VM Arguments部分,您可以在其中添加此内容。

VM参数中的示例条目

-Xms50M -Xmx128M

Program Arguments中,您提到了将传递给Main Class的参数。

答案 1 :(得分:3)

转到Eclipse目录中的eclipse.ini文件。

 -startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130225-1645.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130228-0336
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms1152m
-Xmx1152m

并更改

**openFile
    -vmargs
    -Xms1152m
    -Xmx1152m**

相应。