Let eclipse fly for a while, let eclipse fly

Source: Internet
Author: User
Tags xms

Let eclipse fly for a while, let eclipse fly

Open door

64-bit cpu + 64-bit OS + 64-bit jdk + 64-bit eclipse allows eclipse to fly up and replace one of them with 32-bit.Only when a 64-bit CPU is used together with a 64-bit operating system and runs 64-bit applications can it become a true 64-bit system and reflect the advantage of a 64-bit processor.

 

I. 64-bit cpu

Currently on the market, AMD dual-core series and above are all 64-bit, INTEL dual-core and above processors, desktops are all 64-bit, but inside the notebook, T2XXX series is 32-bit, the rest are 64-bit. At present, single-core machines are basically old-fashioned. You can view the Device Manager to check the number of cores of the machine, as shown below:



Ii. 64-bit operating system and 64-bit jdk, 64-bit eclipseInstall and download. We recommend a csdn eclipse 64-bit (the official website is charged for downloading it). You can use tomcat 8.0 and jdk 1.8.

Http://download.csdn.net/detail/tan3739/8854637

Run the following command to check whether your own 64-bit system and software are installed:.

1.64 The operating system can be viewed through computer> properties, as shown below:

Run the java-d64 version command to view the 2.64-bit jdk: Figure 1 is not 64-bit, and figure 2 is 64-bit.

1.

2.

 

Jdk:

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

3. eclipse can be viewed through the eclipse. ini file. Figure 1 (x86) is 32-bit, and figure 2 (x86_64) is 64-bit.

 

4. After the above environment is set up, let's talk about the eclipse memory settings (eclipse. ini settings or JVM parameter settings)

It mainly involves the following four parameter settings:

-Vmargs-Xms128M-Xmx512M-XX: PermSize = 64 M-XX: MaxPermSize = 128 M
There are two problems:
1. What are the meanings of each parameter?
2. Why can Eclipse be started after I set-Xmx and-XX: MaxPermSize to 512M on some machines, but some machines cannot be started?

Let's answer them one by one.

1. What are the meanings of each parameter?

In the parameters-vmargs indicates setting JVM parameters, so the following are actually JVM parameters. First, let's take a look at the JVM memory management mechanism, and then explain the meaning of each parameter.

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.
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.
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.

 
2. Why can Eclipse be started after I set-Xmx and-XX: MaxPermSize to 512M on some machines, but some machines cannot be started?

Through the introduction of JVM memory management, we have learned that JVM memory includes two types: heap memory and non-heap memory, in addition, the maximum JVM memory depends on the actual physical memory and operating system (the 32-bit operating system has a size limit on memory usage, and the 64-bit operation has no limit ). Therefore, setting VM parameters causes program startup failure mainly due to the following reasons:

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

2)-Xmx value and-XX: The sum of MaxPermSize exceeds the maximum JVM memory limit, such as the maximum memory limit of the current operating system or the actual physical memory. Speaking of the actual physical memory, it should be noted that if your memory is 1024 MB, but it is not likely to be 1024 MB in the actual system, because some of them are occupied by hardware.

3. Change the value of the corresponding position when modifying the parameter.

This configuration is complete and runs too fast. I have fully utilized the i5 machines and 8 GB of memory!

 

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.