How to modify MyEclipse memory, eclipse.ini the role of each parameter.

Source: Internet
Author: User
Tags xms

Modify the memory allocation in the configuration file Eclipse.ini in the Myeclipse/eclipse folder Oh, yes.

===================================

General INI file settings mainly include the following:-vmargs-xms40m-xmx256m-xx:permsize=64m-xx:maxpermsize=128m the meaning of the following explanation. -vmargs: Description is followed by the parameters of the VM-xms40m: Virtual machine occupies the system's minimum memory-xmx256m: Virtual machine occupies the system's maximum memory-xx:permsize: Minimum heap size. Generally reported insufficient memory, are said that this is too small, the remaining heap space is less than 5% will be warned, it is recommended to set this slightly

Larger, but depending on your machine's memory size, set-xx:maxpermsize: Maximum heap size. This is also appropriate larger, so if there is a problem, first adjust the-xms40m: set it smaller, OK, 1g memory recommended set to:-vmargs-xms128m-xmx512m-xx:permsize=256m-xx:maxpermsize=51 2M where-xx:permsize=64m can be set larger, but not more than maxpermsize-xmx512m 5% is 25.6M, theoretically requires that the value of-XMX and-xx:maxpermsize must be greater than 25.6M
===================================

Ultimately it depends on the specific configuration of your machine refer to the following article in the configuration bar

There is a Eclipse.ini file under the Eclipse folder

xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=128m

Here are a few questions:

1. What are the meanings of each parameter?

2. Why do some machines I set-xmx and-xx:maxpermsize to 512M after eclipse can be started, and some machines will not boot?

3. Why is the above parameter written to the Eclipse.ini file eclipse does not perform the corresponding settings?

Here's a reply.

1. What are the meanings of each parameter?

The-vmargs in the parameter is to set the JVM parameters, so the following is actually the JVM parameters, we first understand the JVM memory management mechanism, and then explain the meaning of each parameter represents. Heap (heap) and non-heap (non-heap) memory according to the official statement: "Java virtual machines have a heap, the heap is a runtime data region, and all class instances and arrays of memory are allocated from here." The heap is created when the Java virtual machine is started. "" The memory outside the heap in the JVM is called non-heap (non-heap memory) ". You can see that the JVM primarily manages two types of memory: heap and non-heap. In a nutshell, a heap is a Java code-readable memory that is left to the developer, not a heap, which is left to itself by the JVM, so the method area, the JVM internally processes or optimizes the required memory (such as the JIT-compiled code cache), each class structure (such as running a constant pool, field, and method data) And the code for methods and construction methods are in non-heap memory. The heap memory allocation JVM initially allocates memory specified by-XMS, the default is physical memory 1/64;JVM the maximum allocated memory is specified by-XMX, which defaults to 1/4 of the physical memory. When the default free heap memory is less than 40%, the JVM increases the heap until the maximum limit of-xmx, and when the free heap memory is greater than 70%, the JVM reduces the heap until the minimum limit of-XMS. So the server generally sets-xms,-xmx equal to avoid resizing the heap after each GC. The non-heap memory allocation JVM uses-xx:permsize to set the non-heap memory initial value, which defaults to 1/64 of the physical memory, and by xx:maxpermsize sets the maximum non-heap memory size, which defaults to 1/4 of the physical memory. JVM Memory Limit (max) First JVM memory is limited to the actual maximum physical memory (nonsense!). hehe), assuming that the physical memory is infinitely large, the maximum value of the JVM memory is very much related to the operating system. In short, the 32-bit processor, although the controllable memory space has 4GB, but the specific operating system will give a limit, This limit is generally 2GB-3GB (typically under Windows systems for the 1.5g-2g,linux system 2g-3g), and processors over 64bit are not limited.

2. Why do some machines I set-xmx and-xx:maxpermsize to 512M after eclipse can be started, and some machines will not boot?

We have learned from the above introduction to JVM memory management that there are two types of JVM memory: heap memory and non-heap memory, and the JVM's maximum memory depends first on actual physical memory and operating system. So there are several reasons why setting a VM parameter causes the program to fail to start:

1) The value of-XMS in the parameter is greater than-XMX, or the value of-xx:permsize is greater than-xx:maxpermsize;

2) The sum of-XMX values and-xx:maxpermsize exceeds the maximum limit of JVM memory, such as the maximum memory limit of the current operating system, or actual physical memory, and so on. When it comes to physical memory, it is important to note that if your memory is 1024MB, the actual system is not likely to be 1024MB, because a portion of it is consumed by the hardware.

3. Why is the above parameter written to the Eclipse.ini file eclipse does not perform the corresponding settings? Why is the same argument valid on a shortcut or command line and is not valid in the Eclipse.ini file?

This is because we do not comply with the Eclipse.ini file setting rules: The parameter shape, such as "key value" in this form, there are spaces in the middle of the need to write a newline, if the value of a space in the need to be enclosed in double quotation marks. For example, we use the-VM c:/java/jre1.6.0/bin/javaw.exe parameter to set up the virtual machine, in the Eclipse.ini file to write this:-VM C:/java/jre1.6.0/bin/javaw.exe according to the above mentioned, The last parameter can be written as this in Eclipse.ini: The result of the-vmargs-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=128m actually runs through the eclipse "help" -View the "Configuration Details" button in the "About Eclipse SDK" window.

It is also necessary to note that the contents of the Eclipse.ini file included in the Eclipse compact package are as follows:-showsplash org.eclipse.platform--launcher. Xxmaxpermsize 256m-vmargs-xms40m-xmx256m which –launcher. Xxmaxpermsize (Note that the front is two connectors) the meaning of the-xx:maxpermsize parameter is basically the same, I think the only difference is that the former is the parameter set when the Eclipse.exe is started, and the latter is the parameter in the JVM used by Eclipse. In fact, the two set a can, so here can put –launcher. Xxmaxpermsize and Next line use # comment out.

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

-xx:+useparallelgc

Allows the GC to execute faster. (only new parameters added to the GC in JDK 5)

"MyEclipse has detected, less than 5% of the 64MB of Perm Gen (non-heap memory) space remains." This means that only less than 5% of the non-heap memory is currently idle. So we just have to set this value a bit larger.
The parameters that are set are given in the prompt:
1.-vmargs-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=128m here are a few questions: 1. What are the meanings of each parameter? 2. Why do some machines I set-xmx and-xx:maxpermsize to 512M after eclipse can be started, and some machines will not boot? 3. Why is the above parameter written to the Eclipse.ini file eclipse does not perform the corresponding settings?
Here's a reply.
1. What are the meanings of each parameter?
The-vmargs in the parameter is to set the JVM parameters, so the following is actually the JVM parameters, we first understand the JVM memory management mechanism, and then explain the meaning of each parameter represents.
• Heap and non-heap (non-heap) memory according to the official statement: "Java virtual machines have a heap, the heap is a runtime data region, and all class instances and arrays of memory are allocated from here." The heap is created when the Java virtual machine is started. "" The memory outside the heap in the JVM is called non-heap (non-heap memory) ". You can see that the JVM primarily manages two types of memory: heap and non-heap. In a nutshell, a heap is a Java code-readable memory that is left to the developer, not a heap, which is left to itself by the JVM, so the method area, the JVM internally processes or optimizes the required memory (such as the JIT-compiled code cache), each class structure (such as running a constant pool, field, and method data) And the code for methods and construction methods are in non-heap memory. • Heap memory allocation JVM The initial allocated memory is specified by-XMS, the default is physical memory 1/64;JVM the maximum allocated memory is specified by-XMX, which defaults to 1/4 of the physical memory. When the default free heap memory is less than 40%, the JVM increases the heap until the maximum limit of-xmx, and when the free heap memory is greater than 70%, the JVM reduces the heap until the minimum limit of-XMS. So the server generally sets-xms,-xmx equal to avoid resizing the heap after each GC. • Non-heap memory allocation The JVM uses-xx:permsize to set the non-heap memory initial value, which defaults to 1/64 of the physical memory, and by xx:maxpermsize sets the maximum non-heap memory size, which defaults to 1/4 of the physical memory. JVM Memory Limit (max) First JVM memory is limited to the actual maximum physical memory (nonsense!). hehe), assuming that the physical memory is infinitely large, the maximum value of the JVM memory is very much related to the operating system. In short, the 32-bit processor, although the controllable memory space has 4GB, but the specific operating system will give a limit, This limit is generally 2GB-3GB (typically under Windows systems for the 1.5g-2g,linux system 2g-3g), and processors over 64bit are not limited. 2. Why do some machines I set-xmx and-xx:maxpermsize to 512M after eclipse can be started, and some machines will not boot?
We have learned from the above introduction to JVM memory management that there are two types of JVM memory: heap memory and non-heap memory, and the JVM's maximum memory depends first on actual physical memory and operating system. So there are several reasons why setting a VM parameter causes the program to fail to start:
1) The value of-XMS in the parameter is greater than-XMX, or the value of-xx:permsize is greater than-xx:maxpermsize;
2) The sum of-XMX values and-xx:maxpermsize exceeds the maximum limit of JVM memory, such as the maximum memory limit of the current operating system, or actual physical memory, and so on. When it comes to physical memory, it is important to note that if your memory is 1024MB, the actual system is not likely to be 1024MB, because a portion of it is consumed by the hardware.
3. Why is the above parameter written to the Eclipse.ini file eclipse does not perform the corresponding settings?
Why is the same argument valid on a shortcut or command line and is not valid in the Eclipse.ini file? This is because we have not complied with the setup rules for Eclipse.ini files:
Parameter shape such as "Item Value" In this form, there are spaces in the middle of the need to write a newline, if there are spaces in the value need to be enclosed in double quotation marks. For example, we use the-VM c:/java/jre1.6.0/bin/javaw.exe parameter to set up the virtual machine, in the Eclipse.ini file to write this:
1.-VM 2.c:/java/jre1.6.0/bin/javaw.exe According to the above, the final parameters in Eclipse.ini can be written in this way:
1.-vmargs 2.-xms128m 3.-xmx512m 4.-xx:permsize=64m 5.-xx:maxpermsize=128m The actual operation results can be achieved through Eclipse "help"-"about eclipse The "Configuration Details" button in the SDK window.
It is also necessary to note that the contents of the Eclipse.ini file included in the Eclipse compression package are as follows:
1.-showsplash 2.org.eclipse.platform 3.--launcher. Xxmaxpermsize 4.256m 5.-vmargs 6.-xms40m 7.-xmx256m which –launcher. Xxmaxpermsize (Note that the front is two connectors) the meaning of the-xx:maxpermsize parameter is basically the same, I think the only difference is that the former is the parameter set when the Eclipse.exe is started, and the latter is the parameter in the JVM used by Eclipse. In fact, the two set a can, so here can put –launcher. Xxmaxpermsize and Next line use # comment out.
Can directly set the eclipse.in inside parameters!

How to modify MyEclipse memory, eclipse.ini the role of each parameter.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.