Eclipse.ini memory Configuration

Source: Internet
Author: User
Tags xms

Eclipse.ini Memory Settings

-vmargs-xms128m-xmx512m-xx:permsize=64m-xx:maxpermsize=128m
Here are a few questions:
1. What is the meaning of each parameter?
2. Why some machines I have-xmx and-xx:maxpermsize are set to 512M after eclipse can start, and some machines will not start.
3. Why write the above parameter to the Eclipse.ini file eclipse does not perform the corresponding setting.

Let's answer each of these.

1. What is the meaning of each parameter?

Parameter-vmargs means set JVM parameters, so the following are actually parameters of the JVM, we first look at 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 the Run-time data region, all class instances and arrays of memory are allocated from here." The heap was created when the Java virtual machine was started. "" Memory outside the heap in the JVM is called Non heap memory (non-heapmemory). You can see that the JVM mainly manages two types of memory: the heap and the non heap. Simply put, the heap is the memory that Java code can have, is reserved for developers, and not heaps are for the JVM to use, so the method area, JVM internal processing or tuning required memory (such as JIT-compiled code caching), 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
The initial memory allocated by the JVM is specified by-XMS, and the default is physical memory 1/64;JVM the maximum allocated memory is specified by-XMX, which defaults to 1/4 of physical memory. When the default free heap memory is less than 40%, the JVM increases the maximum limit for the heap until-xmx, and when the free heap memory is greater than 70%, the JVM reduces the heap until the minimum limit of-XMS. Therefore, the server generally sets-xms and-xmx equal to avoid resizing the heap after each GC.
Non-heap memory allocation
The JVM uses-xx:permsize to set a non heap memory initial value, which defaults to 1/64 of physical memory, and the maximum amount of non heap memory is set by Xx:maxpermsize, which defaults to 1/4 of physical memory.
JVM memory limit (maximum)
First, JVM memory is limited to the actual maximum physical memory (nonsense.) Well, assuming that the physical memory is infinite, the maximum value of JVM memory is related to the operating system. To put it simply, the 32-bit processor, while the controllable memory space has 4GB, will give a limit to the specific operating system This limitation is generally 2GB-3GB (generally the Windows system under the 1.5g-2g,linux system is 2g-3g), and more than 64bit of processors will not be limited.
2. Why some machines I have-xmx and-xx:maxpermsize are set to 512M after eclipse can start, and some machines will not start.

With the above introduction to JVM memory management, we have learned that JVM memory consists of two types: heap memory and non heap memory, and that the JVM's maximum memory depends first on the actual physical memory and operating system. So setting the VM parameters causes the program not to start mainly for the following reasons:

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

2-xmx values and-xx:maxpermsize totals exceed the maximum JVM memory limits, such as the current operating system maximum memory limit, or actual physical memory, and so on. When it comes to actual physical memory, the point is, if your memory is 1024MB, it's not possible to use 1024MB in the actual system, because some of it is consumed by the hardware.

3. Why write the above parameter to the Eclipse.ini file eclipse does not perform the corresponding setting.

So why is the same parameter valid on the shortcut or command line and is not valid in the Eclipse.ini file? This is because we did not comply with the set rules for the Eclipse.ini file:

Parameters such as "Item Value" In this form, there are spaces in the middle of the need for line-wrapping, if the value of space in the need to include double quotes. For example, we use the-vmc:\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, the final parameter in Eclipse.ini can be written in this way:

-vmargs
-xms128m
-xmx512m
-xx:permsize=64m
-xx:maxpermsize=128m
The results of the actual operation can be viewed through the "configurationdetails" button in Eclipse's Help-abouteclipse SDK window.

It is also important to note that the contents of the Eclipse.ini file included in the Eclipse compression package are as follows:

-showsplash
Org.eclipse.platform
--launcher. Xxmaxpermsize
256m
-vmargs
-xms40m
-xmx256m
Which –launcher. Xxmaxpermsize (Note that the first two connectors) and-xx:maxpermsize parameters are basically the same meaning, I think the only difference is that the former is a 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 the next line use # comments.

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

-xx:+useparallelgc

Allow the GC to execute faster. (only the newly added parameters to the GC in JDK 5)

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.