eclipse ini配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/477871/
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
eclipse ini configuration
提问by Gunwant Saini
actually i and my friend are trying to learn and use eclipse 3.4 and we are having some heap memory issue while working, and my friend suggested to increase the memory allocation to eclipse ide as he has 4GB RAM and he wants to allocate enough heap, allocate decent perm size, and enable parallel garbage collection to this eclipse ide.
实际上,我和我的朋友正在尝试学习和使用 eclipse 3.4,我们在工作时遇到了一些堆内存问题,我的朋友建议增加 eclipse ide 的内存分配,因为他有 4GB RAM 并且他想分配足够的堆,分配合适的烫发大小,并为这个 Eclipse ide 启用并行垃圾收集。
we people are unable to achieve this by modifying the eclipse.ini file and he wants to allocate 1GB of RAM to eclipse.
我们这些人无法通过修改 eclipse.ini 文件来实现这一点,他想为 eclipse 分配 1GB 的 RAM。
kindly please help us in this
请在这方面帮助我们
Thanks
谢谢
回答by TataBlack
Just for reference: as Carsten said, the eclipse.ini
file is quite picky about the order and format of its lines. Here's their Wiki page, with some example configurations.
As they say, remember that:
仅供参考:正如 Carsten 所说,该eclipse.ini
文件对其行的顺序和格式非常挑剔。这是他们的 Wiki 页面,其中包含一些示例配置。
正如他们所说,请记住:
- Each option and each argument to an option must be on its own line.
- All lines after
-vmargs
are passed as arguments to the JVM, so all arguments and options for eclipse must be specified before-vmargs
(just like when you use arguments on the command-line)
- 每个选项和选项的每个参数都必须单独一行。
- 后面的所有行都
-vmargs
作为参数传递给 JVM,因此必须在前面指定 eclipse 的所有参数和选项-vmargs
(就像在命令行上使用参数时一样)
So, for example, you can set the MaxPermSize
with an Eclipse launcher-specific option (option name on the first line, option value on the next):
因此,例如,您可以MaxPermSize
使用 Eclipse 启动器特定选项(第一行的选项名称,下一行的选项值)设置 :
--launcher.XXMaxPermSize
256m
Then, after the -vmargs
option name, you can pass the parameters relative to the garbage collector. For example:
然后,在-vmargs
选项名称之后,您可以传递与垃圾收集器相关的参数。例如:
-vmargs
-XX:-UseParallelGC
Hope it helps.
希望能帮助到你。
回答by Uri
The default allocation is ridiculous on modern machines; I wish Eclipse would adjust the default to the actual machine or at least be more interactive.
现代机器上的默认分配是荒谬的;我希望 Eclipse 将默认值调整为实际机器或至少更具交互性。
As suggested by Eric, you should increase the max heap. However, you may also want to adjust permgen.
正如 Eric 所建议的,您应该增加最大堆。但是,您可能还想调整 permgen。
I've seen somewhere the following numbers:
我曾在某处看到以下数字:
For 512MB RAM: -Xms256m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=64m
对于 512MB 内存: -Xms256m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=64m
For 1024MB Ram: -vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m
对于 1024MB 内存: -vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m
For 4GB Ram the recommendation was to go 1024m ram if you need it, and as much as 512m permgen if you need it.
对于 4GB 内存,如果需要,建议使用 1024m 内存,如果需要,建议使用 512m permgen。
回答by Ediz Türko?lu
My configurations for 8gb RAM:
我的 8GB RAM 配置:
--launcher.XXMaxPermSize
128M
-Xms1024m
-Xmx2048m
-XX:MaxPermSize=1048m
The reason I gave a high value for Xms is that I don't want to wait and watch continuous increase of memory usage while getting started.
我给 Xms 一个高值的原因是我不想在开始时等待并观察内存使用量的持续增加。
回答by EricSchaefer
Put this line into your eclipse.ini:
将此行放入您的 eclipse.ini 中:
-Xmx1024m
-Xmx1024m
回答by user2120239
You can add the -XX:MaxPermSize=1024M
in the eclipse.ini ORyou could invoke the Eclipse.exe with paramerets in the command-line or via updating the "Target Path" in the shortcut,
您可以-XX:MaxPermSize=1024M
在 eclipse.ini 中添加或者您可以在命令行中使用参数调用 Eclipse.exe 或通过更新快捷方式中的“目标路径”,
eclipse -vmargs -XX:PermSize=512M -XX:MaxPermSize=1024M
http://wiki.eclipse.org/Eclipse.inihttp://wiki.eclipse.org/FAQ_How_do_I_increase_the_permgen_size_available_to_Eclipse%3F
http://wiki.eclipse.org/Eclipse.ini http://wiki.eclipse.org/FAQ_How_do_I_increase_the_permgen_size_available_to_Eclipse%3F
回答by Tomá? Holas
This is my configuration on a 4GB Mac:
这是我在 4GB Mac 上的配置:
-Xms1256m -Xmx1256m -XX:MaxPermSize=666m -XX:PermSize=666m
-Xms1256m -Xmx1256m -XX:MaxPermSize=666m -XX:PermSize=666m
It's about the maximum allowed, when I try more, it tells me "cannot start virtual machine". Works well :)
这是允许的最大值,当我尝试更多时,它告诉我“无法启动虚拟机”。效果很好 :)
回答by Mehmed Mert
In general, the proper optimization depends also on your vm-version and the underlying hardware.
通常,适当的优化还取决于您的 vm 版本和底层硬件。
check out this: http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#PerformanceTuning
看看这个:http: //www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#PerformanceTuning