增加Eclipse的JVM最大堆大小。

时间:2022-09-29 07:45:38

I am trying to increase the max heap size for my Eclipse. I have tried specifying in eclipse.ini or through the command line, but are not working.

我正在尝试增加Eclipse的最大堆大小。我已经尝试在eclipse中指定。ini或通过命令行,但不工作。

My max heap size has the exact same limit before (running jconsole) and after (System.out.println(java.lang.Runtime.getRuntime().maxMemory());) starting Eclipse. 1.8G

我的最大堆大小在(运行jconsole)和after (System.out.println(java.lang.Runtime.getRuntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime . getruntime。

  1. Is there any way to modify JVM heap size before it is launched (ex. a config file?)
  2. 在启动之前,是否有任何方法可以修改JVM堆大小(ex. a配置文件?)
  3. What could I be doing wrong when specifying heap size to Eclipse?
  4. 在将堆大小指定为Eclipse时,我可能做错了什么?

This is the command:

这是命令:

./eclipse/eclipse -debug -consoleLog -vmargs -Xms1000m -Xmx6000m -XX:-UseGCOverheadLimitcl

This is my eclipse.ini (which values are overwritten by the specified eclipse launching parameters):

这是我的eclipse。ini(该值被指定的eclipse启动参数覆盖):

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120522-1813
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Dhelp.lucene.tokenizer=standard
-XX:MaxPermSize=6000m
-Xms1000m
-Xmx6000m

5 个解决方案

#1


24  

It is possible to increase heap size allocated by the Java Virtual Machine (JVM) by using command line options.

通过使用命令行选项,可以增加由Java虚拟机(JVM)分配的堆大小。

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size

If you are using the tomcat server, you can change the heap size by going to Eclipse/Run/Run Configuration and select Apache Tomcat/your_server_name/Arguments and under VM arguments section use the following:

如果您正在使用tomcat服务器,您可以通过使用Eclipse/Run/Run配置来更改堆大小,并选择Apache tomcat /your_server_name/参数,在VM参数下使用以下内容:

-XX:MaxPermSize=256m
-Xms256m -Xmx512M

If you are not using any server, you can type the following on the command line before you run your code:

如果您没有使用任何服务器,您可以在运行代码之前在命令行输入以下命令:

java -Xms64m -Xmx256m HelloWorld

More information on increasing the heap size can be found here

关于增加堆大小的更多信息可以在这里找到。

#2


12  

You can use this configuration:

您可以使用此配置:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M

#3


5  

There is also Optimizer for Eclipse that can increase heap size with one click.

还有一个Eclipse优化器,它可以通过单击来增加堆大小。

http://marketplace.eclipse.org/content/optimizer-eclipse

http://marketplace.eclipse.org/content/optimizer-eclipse

增加Eclipse的JVM最大堆大小。

#4


4  

Try to modify the eclipse.ini so that both Xms and Xmx are of the same value:

尝试修改eclipse。因此,Xms和Xmx都具有相同的值:

-Xms6000m
-Xmx6000m

This should force the Eclipse's VM to allocate 6GB of heap right from the beginning.

这将迫使Eclipse的VM从一开始就分配6GB的堆。

But be careful about either using the eclipse.ini or the command-line ./eclipse/eclipse -vmargs .... It should work in both cases but pick one and try to stick with it.

但是要小心使用eclipse。ini或者命令行。/ eclipse / eclipse—vmargs ....它应该在两种情况下都有效,但是选择一个并坚持下去。

#5


2  

--launcher.XXMaxPermSize

——launcher.XXMaxPermSize

256m

256米

Try to bump that value up!

试着把那个值提高!

#1


24  

It is possible to increase heap size allocated by the Java Virtual Machine (JVM) by using command line options.

通过使用命令行选项,可以增加由Java虚拟机(JVM)分配的堆大小。

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size

If you are using the tomcat server, you can change the heap size by going to Eclipse/Run/Run Configuration and select Apache Tomcat/your_server_name/Arguments and under VM arguments section use the following:

如果您正在使用tomcat服务器,您可以通过使用Eclipse/Run/Run配置来更改堆大小,并选择Apache tomcat /your_server_name/参数,在VM参数下使用以下内容:

-XX:MaxPermSize=256m
-Xms256m -Xmx512M

If you are not using any server, you can type the following on the command line before you run your code:

如果您没有使用任何服务器,您可以在运行代码之前在命令行输入以下命令:

java -Xms64m -Xmx256m HelloWorld

More information on increasing the heap size can be found here

关于增加堆大小的更多信息可以在这里找到。

#2


12  

You can use this configuration:

您可以使用此配置:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M

#3


5  

There is also Optimizer for Eclipse that can increase heap size with one click.

还有一个Eclipse优化器,它可以通过单击来增加堆大小。

http://marketplace.eclipse.org/content/optimizer-eclipse

http://marketplace.eclipse.org/content/optimizer-eclipse

增加Eclipse的JVM最大堆大小。

#4


4  

Try to modify the eclipse.ini so that both Xms and Xmx are of the same value:

尝试修改eclipse。因此,Xms和Xmx都具有相同的值:

-Xms6000m
-Xmx6000m

This should force the Eclipse's VM to allocate 6GB of heap right from the beginning.

这将迫使Eclipse的VM从一开始就分配6GB的堆。

But be careful about either using the eclipse.ini or the command-line ./eclipse/eclipse -vmargs .... It should work in both cases but pick one and try to stick with it.

但是要小心使用eclipse。ini或者命令行。/ eclipse / eclipse—vmargs ....它应该在两种情况下都有效,但是选择一个并坚持下去。

#5


2  

--launcher.XXMaxPermSize

——launcher.XXMaxPermSize

256m

256米

Try to bump that value up!

试着把那个值提高!