博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
eclipse.ini vm参数– eclipse.ini文件位置Mac,Windows
阅读量:2533 次
发布时间:2019-05-11

本文共 4888 字,大约阅读时间需要 16 分钟。

eclipse.ini is the configuration file used to control the Eclipse startup. We can configure Eclipse VM arguments such as JDK to be used (eclipse.ini vm), permgen space, maximum and minimum heap size using Xms, Xmx parameters.

eclipse.ini是用于控制Eclipse启动的配置文件。 我们可以使用Xms,Xmx参数配置要使用的Eclipse VM参数,例如JDK(eclipse.ini vm),permgen空间,最大和最小堆大小。

eclipe.ini文件位置 (eclipe.ini File Location)

For windows, it’s in the same directory as eclipse.exe file, as shown in below image.

对于Windows,它与eclipse.exe文件位于同一目录中,如下图所示。

For Mac OS X, it’s found inside the app. So if Eclipse app is in Downloads directory, eclipse.ini file location will be:

对于Mac OS X,可以在应用程序中找到它。 因此,如果Eclipse应用位于“下载”目录中,则eclipse.ini文件的位置将为:

pankaj$ cd ~/Downloads/Eclipse.app/Contents/Eclipse/

You can reach this location by first right clicking on Eclipse app and click on “Show Package Contents” and then in the next window navigate to Contents/Eclipse directory, as shown in below images.

您可以通过首先右键单击Eclipse应用程序并单击“显示包内容”,然后在下一个窗口中导航到Contents/Eclipse目录来到达此位置,如下图所示。

Here is the example eclipse.ini file from my default eclipse installation.

这是默认安装中的示例eclipse.ini文件。

-startup../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar--launcher.library../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m--launcher.defaultActionopenFile--launcher.appendVmargs-vmargs-Dosgi.requiredJavaVersion=1.7-XstartOnFirstThread-Dorg.eclipse.swt.internal.carbon.smallFonts-XX:MaxPermSize=256m-Xms256m-Xmx1024m-Xdock:icon=../Resources/Eclipse.icns-XstartOnFirstThread-Dorg.eclipse.swt.internal.carbon.smallFonts

Some important points about eclipse.ini file are:

关于eclipse.ini文件的一些重要点是:

  1. Each line before -vmargs contains an option followed by the value for option.

    -vmargs之前的每一行都包含一个选项,后跟option值。
  2. All the lines after -vmargs are passed as JVM arguments, so all options and arguments for eclipse startup must be specified before -vmargs. For example -vm settings for JDK to be used.

    -vmargs之后的所有行均作为JVM参数传递,因此,必须在-vmargs之前指定用于Eclipse启动的所有选项和参数。 例如,将使用JDK的-vm设置。
  3. –launcher.XXMaxPermSize specifies the maximum permgen space to use by eclipse launcher, increase this value if your eclipse startup is failing with out of memory error.

    –launcher.XXMaxPermSize指定eclipse启动程序要使用的最大permgen空间,如果eclipse启动失败并出现内存不足错误,请增加此值。
  4. If you are getting Out of Memory errors, you should try to increase Permgen space and maximum heap space values. They are configured using VM arguments -XX:MaxPermSize, -Xms and -Xmx. Permgen space default value is configured as 256MB that is good for small to medium projects.

    如果遇到内存不足错误,则应尝试增加Permgen空间和最大堆空间值。 使用VM参数-XX:MaxPermSize-Xms-Xmx对其进行配置 。 Permgen空间的默认值配置为256MB,适合中小型项目。

eclipse.ini vm参数 (eclipse.ini vm argument)

eclipse.ini vm argument is useful when you have multiple JDK installation and you want to make sure that your eclipse runs on a specific JVM, rather than picking system configured jdk path. It must be defined before -vmargs.

eclipse.ini vm参数在安装多个JDK并希望确保eclipse在特定的JVM上运行而不是选择系统配置的jdk路径时很有用。 必须在-vmargs之前定义

eclipse.ini vm参数Mac (eclipse.ini vm argument Mac)

My eclipse.ini file snippet showing -vm argument usage to configure eclipse to use JDK8 in Mac OS X.

我的eclipse.ini文件片段显示了-vm参数用法,用于配置eclipse在Mac OS X中使用JDK8。

-vm/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin-vmargs

You can configure it similarly for Windows or Linux operating systems. Just change the JDK bin directory path accordingly.

您可以为Windows或Linux操作系统进行类似配置。 只需相应地更改JDK bin目录路径。

eclipse.ini彼尔姆根空间 (eclipse.ini Permgen Space)

If you are getting java.lang.OutOfMemoryError: PermGen space error, mostly when you are working on larger code base, doing maven update for large projects etc. , then you should increase Permgen space. Below is the configuration to increase permgen space to 512 MB in eclipse.ini file.

如果您遇到java.lang.OutOfMemoryError: PermGen space错误,主要是在使用较大的代码库,对大型项目进行maven更新等时,则应增加Permgen空间。 下面是将eclipse.ini文件中的permgen空间增加到512 MB的配置。

-XX:MaxPermSize=512M

Note that there is no more Permgen space from Java 8 onwards, so setting this option will have no effect. However you will also not get out of memory error because of permgen space.

请注意,从Java 8开始,不再有Permgen空间,因此设置此选项将无效。 但是,由于permgen空间,您也不会出现内存不足错误。

eclipse.ini堆空间 (eclipse.ini Heap Space)

If you are getting OutOfMemoryError related to Heap space, then you can try to increase the maximum heap size available to eclipse. You can easily do it by editing -Xmx value. For example, below snippet will increase the eclipse heap size to 2 GB.

如果您获得与堆空间有关的OutOfMemoryError,则可以尝试增加可用于Eclipse的最大堆大小。 您可以通过编辑-Xmx值轻松地做到这一点。 例如,以下代码段会将eclipse堆的大小增加到2 GB。

-Xmx2048m

That’s all for a quick roundup on eclipse.ini configuration and VM arguments.

这就是对eclipse.ini配置和VM参数的快速汇总。

翻译自:

转载地址:http://ifqzd.baihongyu.com/

你可能感兴趣的文章
算法练习题
查看>>
学习使用Django一 安装虚拟环境
查看>>
Hibernate视频学习笔记(8)Lazy策略
查看>>
CSS3 结构性伪类选择器(1)
查看>>
IOS 杂笔-14(被人遗忘的owner)
查看>>
自动测试用工具
查看>>
前端基础之BOM和DOM
查看>>
[T-ARA/筷子兄弟][Little Apple]
查看>>
编译Libgdiplus遇到的问题
查看>>
【NOIP 模拟赛】Evensgn 剪树枝 树形dp
查看>>
java学习笔记④MySql数据库--01/02 database table 数据的增删改
查看>>
两台电脑如何实现共享文件
查看>>
组合模式Composite
查看>>
程序员最想得到的十大证件,你最想得到哪个?
查看>>
我的第一篇CBBLOGS博客
查看>>
【MyBean调试笔记】接口的使用和清理
查看>>
07 js自定义函数
查看>>
jQueru中数据交换格式XML和JSON对比
查看>>
form表单序列化后的数据转json对象
查看>>
[PYTHON]一个简单的单元測试框架
查看>>