eclipse.ini memory settings

来源:互联网 发布:淘宝男士内裤店铺推荐 编辑:程序博客网 时间:2024/05/16 15:48

eclipse.ini memory settings

-vmargs-Xms128M-Xmx512M-XX: PermSize = 64M-XX: MaxPermSize = 128M

There are several questions:

1. What is the meaning of each parameter?

2. Why are some machines I will be-Xmx and-XX: MaxPermSize is set to512M can start after the Eclipse, and some machines can not start?

3. Why the above parameters are written to the eclipse.ini file failed to implement the corresponding Eclipse settings?

Here we have been able to answer

1. What is the meaning of each parameter?

Parameter-vmargs means is to set JVM parameters, so the back of whichare the parameters of the JVM, we first look at JVM memory managementmechanism, and then explain the meaning of each parameterrepresentative.

Heap (Heap) and non-heap (Non-heap) memory

In accordance with the official statement: Java virtual machine has aheap, the heap is the runtime data area, all the class instances and anarray of memory are allocated from here. Heap is a Java virtual machinestartup created. Outside of the heap in the JVM memory is callednon-heap memory (Non-heap memory). JVM key management can be seen thattwo types of memory: heap and non-heap. To put it simply is the Javacode could be in the heap and the memory is reserved for developers touse; non-heap is the JVM to use for themselves, so methods that, JVMrequired for internal processing or optimization of memory (such as JITcompiled code cache), each class structure (such as run from time totime the number of pools, fields and methods of data), as well asmethod and constructor code in the non-heap memory.

Heap memory allocation

JVM initial allocation of memory specified by-Xms, the default is thephysical memory of 1 / 64; JVM maximum allocation of memory by the-Xmxspecified, the default is the physical memory 1 / 4. Default spare lessthan 40% of heap memory, JVM heap will be increased until themaximum-Xmx limits; spare more than 70% of heap memory, JVM heap willbe reduced until the minimum-Xms restrictions. Therefore, the generalset up a server-Xms,-Xmx equal in order to avoid adjustments after eachGC heap size.

Non-heap memory allocation

JVM usingthe-XX: PermSize to set the initial value of non-heap memory, thedefault is the physical memory of 1 / 64; by XX: MaxPermSize set themaximum size of non-heap memory, the default is the physical memory of1 / 4.

JVM memory limit (max)

First of all JVMmemory limit the actual maximum physical memory (nonsense! Hehe),assuming infinite physical memory, then, JVM memory, the maximum valueof a great relationship with the operating system. Simply put, the32-bit processors, although the controlled memory space is 4GB, butwill give a specific operating system restrictions, this limit isgenerally 2GB-3GB (generally Windows systems under 1.5G-2G, Linuxsystem under 2G-3G), while the 64bit processor, there will be no morethan limited.

2. Why are some machines I will be-Xmx and-XX:MaxPermSize is set to 512M can start after the Eclipse, and somemachines can not start?

JVM memory management through theintroduction of the face that we have learned that contains two kindsof JVM memory: heap memory and non-heap memory, another JVM maximummemory depends primarily on the actual physical memory and operatingsystem. So set the VM parameters causes the program to fail to startmainly for the following reasons:

1) the value of-Xms parameter is greater than-Xmx, or-XX: PermSize is greater than the value of-XX: MaxPermSize;

2)-Xmx values and-XX: MaxPermSize more than the sum of the maximum JVMmemory limits, such as the current operating system, the maximum memorylimit, or the actual physical memory and so on. Talking about theactual physical memory are required at this point is, if your memory is1024MB, but it is not used in the actual system may be 1024MB, becauseit occupied in part by the hardware.

3. Why the above parameters are written to the eclipse.ini file failed to implement the corresponding Eclipse settings?

So why the same parameters in the shortcut or the command lineeffectively in the eclipse.ini document is invalid it? This is becausewe do not have to comply with the rules set eclipse.ini file:

Parameters of the value of this form is shaped like a key in the middlethere is a space to change their line of writing, if the value hasspaces in double quotes, including the need to use them. For instance,we use the-vm C: Javajre1.6.0binjavaw.exe parameter is set to thevirtual machine, in the eclipse.ini document should be rewritten likethis:

-vm
C:Javajre1.6.0binjavaw.exe


In accordance with the above mentioned, the final parameters eclipse.ini can be written like this:

-vmargs
-Xms128M
-Xmx512M
-XX:PermSize=64M
-XX:MaxPermSize=128M


Actual results can be run through the Eclipse in the Help-About EclipseSDK window inside the Configuration Details button to view it.

Also must be explained, Eclipse comes with eclipse.ini compressed package contents of the file like this:

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m


One launcher.XXMaxPermSize (Note that the top of the two connectinglines) with the-XX: MaxPermSize parameter is basically the samemeaning, I think the only difference is that the former is the time tostart eclipse.exe set the parameters, which is the eclipse used by theJVM parameters. In fact, you can set up a two, so there can belauncher.XXMaxPermSize and the next line to use # comment.

3. Other startup parameters. If you have a dual-core CPU, may be able to try this parameter:

-XX:+UseParallelGC

Let GC faster implementation. (Only JDK 5 years of GC additional parameters)

原创粉丝点击