In eclipse. INI/myeclipse. ini, configure parameters-XMS,-xmx,-persize // optimize eclipse

Source: Internet
Author: User
Tags xms
Configure parameters-XMS,-xmx, and-persize in eclipse. INI/myeclipse. ini

I checked some articles about optimizing myeclipse speed this afternoon and benefited a lot. However, you need to know why. For example, when we mention modifying the values of-XMS,-xmx, and-persize in the myeclipse. ini file, what are the specific parameters? I have collected some information on the Internet, as shown below:
This involves the JVM memory management mechanism.
1.Heap and non-heap memory
According to the official statement: "A Java virtual machine has a heap. The heap is the runtime data area, and the memory of all class instances and arrays is allocated from this place. The heap is created when the Java Virtual Machine is started ." "Memory outside of the heap in JVM is called non-heap memory )". JVM manages two types of memory: heap and non-heap. In short, heap is the memory available for Java code and is reserved for developers. Non-heap is reserved for JVM, therefore, the method area, JVM internal processing or optimization of the required memory (such as the code cache after JIT compilation), each class structure (such as the runtime data pool, field and method data) the methods and constructor code are all in non-heap memory.

2.Heap Memory Allocation
The initial memory allocated by JVM is specified by-XMS. The default value is 1/64 of the physical memory. The maximum memory allocated by JVM is specified by-xmx. The default value is 1/4 of the physical memory. By default, when the free heap memory is less than 40%, the JVM will increase the heap until the maximum limit of-xmx. When the free heap memory is greater than 70%, the JVM will reduce the minimum limit of heap until-XMS. Therefore, the server generally sets-XMS and-xmx to be equal to each other to avoid adjusting the heap size after each GC.

3. Non-heap memory allocation
JVM uses-XX: permsize to set the non-heap memory initial value. The default value is 1/64 of the physical memory. The maximum non-heap memory size is set by XX: maxpermsize. The default value is 1/4 of the physical memory.

4. JVM memory limit (maximum)
First, the JVM memory is limited to the actual maximum physical memory. If the physical memory is infinitely large, the maximum JVM memory has a great relationship with the operating system. Simply put, although the 32-bit processor has a controllable memory space of 4 GB, the specific operating system will impose a limit, this limit is generally 2 GB-3 GB (1.5 GB-2 GB in windows and 2 GB-3 GB in Linux ), the 64-bit and above processors will not be limited.

Example description:
-Xms128m indicates the JVM heap (heap memory) minimum size of 128 MB, initial allocation
-Xmx512m indicates the maximum size allowed by JVM heap (heap memory) is 256 MB, which is allocated as needed.
NOTE: If-xmx is not specified or the value is too small, the application may cause a java. Lang. outofmemory error. This error is caused by the failure of JVM throwable and cannot be captured using try... catch.

Permsize and maxpermsize indicate that the virtual machine allocates memory restrictions for the permanate generation objects such as class objects and method objects, these memories are not included in heap (heap memory.
-XX: permsize = 64 MB minimum size, initial allocation
-XX: maxpermsize = 256 MB: the maximum size allowed for allocation, which is allocated on demand.
Too small will cause: Java. Lang. outofmemoryerror: permgen Space
The default value of maxpermsize is related to the-server-Client Option. -Maxpermsize is 64 MB by default under the server option
-In the client option, the default maxpermsize is 32 MB.

PS: different manufacturers have different JDK garbage collection algorithms. In Sun's JDK, The XMS and xmx settings are the same, which can reduce the pressure caused by the size of the scaling heap. However, setting the same settings under IBM's JDK will increase the chance of heap fragmentation.

The following describes the main methods to optimize myeclipse speed:
1. Modify myeclipse. ini.
2. Cancel automatic validation
3. Remove useless plug-ins.
4. Modify the startup and loading Module

The detailed myeclipse speed optimization method is attached below: (reprinted)
Http://yufenfei.javaeye.com/blog/376464
Http://blog.csdn.net/defonds/archive/2009/07/10/4338782.aspx
Http://zhangpengshou.javaeye.com/blog/198476
Http://queue19.javaeye.com/blog/488017

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.