如何在 Eclipse 中增加应用程序堆大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15313393/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to increase application heap size in Eclipse?
提问by Sophie Sperner
Some say I need to do that in Run Configurations for my application. When I open that window, could you please tell me how to set the right argument and the amount of memory? Say how to set 2GB or 1.5GB?
有人说我需要在我的应用程序的运行配置中这样做。当我打开那个窗口时,你能告诉我如何设置正确的参数和内存量吗?请问如何设置2GB或1.5GB?
回答by benzonico
In the run configuration you want to customize (just click on it) open the tab Arguments
and add -Xmx2048m
in the VM arguments section.
You might want to set the -Xms
as well (small heap size).
在要自定义的运行配置中(只需单击它),打开选项卡Arguments
并添加-Xmx2048m
VM 参数部分。您可能还想设置-Xms
(小堆大小)。
回答by Faakhir
- Go to Eclipse Folder
- Find Eclipse Icon in Eclipse Folder
- Right Click on it you will get option "Show Package Content"
- Contents folder will open on screen
- If you are on Mac then you'll find "MacOS"
- Open MacOS folder you'll find eclipse.ini file
Open it in word or any file editor for edit
...
-XX:MaxPermSize=256m -Xms40m -Xmx512m
...
Replace -Xmx512m to -Xmx1024m
- Save the file and restart your Eclipse
- Have a Nice time :)
- 转到 Eclipse 文件夹
- 在 Eclipse 文件夹中查找 Eclipse 图标
- 右键单击它,您将获得“显示包内容”选项
- 内容文件夹将在屏幕上打开
- 如果您使用的是 Mac,那么您会找到“MacOS”
- 打开 MacOS 文件夹,你会发现 eclipse.ini 文件
在 word 或任何文件编辑器中打开它进行编辑
...
-XX:MaxPermSize=256m -Xms40m -Xmx512m
...
将 -Xmx512m 替换为 -Xmx1024m
- 保存文件并重新启动 Eclipse
- 有一个美好的时光:)
回答by sashikanta
Find the Run button present on the top of the Eclipse, then select Run Configuration -> Arguments, in VM arguments section just mention the heap size you want to extend as below:
找到 Eclipse 顶部的 Run 按钮,然后选择 Run Configuration -> Arguments,在 VM arguments 部分中只提及您要扩展的堆大小,如下所示:
-Xmx1024m
回答by Chinmoy
In Eclipse Folder there is eclipse.ini file. Increase size -Xms512m
-Xmx1024m
在 Eclipse 文件夹中有 eclipse.ini 文件。增加尺寸 -Xms512m
-Xmx1024m
回答by Ravi pandey
Open eclipse.ini
打开 eclipse.ini
Search for -Xmx512m
or maybe more size it is.
搜索-Xmx512m
或可能更大的尺寸。
Just change it to a required size such as I changed it to -Xmx1024m
只需将其更改为所需的大小,例如我将其更改为 -Xmx1024m