Eclipse Performance Tuning

Source: Internet
Author: User


Recently, eclipse (Eclipse-JEE3.5) runs very slowly (maybe too many plug-ins are installed), so there is a chance to tune it up to improve productivity
Is the GC condition of eclipse without any adjustment (use the jvisualvm command to install the visual GC plug-in)

We can see that there are 38 young GC and 11 full GC operations during the startup process.
To view GC details, add the following parameters to eclipse. ini:
-Verbose: GC
-XX: + printgcdetails
-XX: + printgcdatestamps
-Xloggc: D:/soft/eclipse-jee/GC. Log
The GC content is as follows:

From the GC log, we can see that:
(1) The young district started to be 4928 K, which was not enough, resulting in continuous young GC.
(2) In full GC, the space in the old area is increased and expanded, so the space in the old area is not enough.
To prevent this, add the following parameters:
-Xms768m
-Xmx768m
-XX: newsize = 512 m
-XX: maxnewsize = 512 m
The adjusted result is as follows:

We can see that young GC is gone, but why is it still 11 full GC?
The following is the GC log:

From GC. Log, we can see that full GC is caused by the absence of space in the perm zone. Therefore, the perm zone is increased and fixed.
Add the following parameters:
-XX: permsize = 96 m
-XX: maxpermsize = 96 m
The adjusted results are as follows:

It can be seen that there is no full GC, and young GC only has one time, with a certain effect
The GC problem is solved at startup. Now let's look at other problems:

It can be seen that if the classloader can load the class faster, it will save some time.
Add the following parameters:
-Xverify: none (disabling Java bytecode verification speeds up class loading)

Compare the above two figures
First: the average loading time of each class is 54.615/10950 = 0.0049876712328767 S.
Second: the average loading time of each class is 34.498/9484 = 0.0036374947279629 S.
We can see that there are some performance improvements.
Considering that eclipse has been running for a long time, other adjustments may be as follows:
(1) Disable system. GC ()
(2) Improve JIT compilation of some code in eclipse
(3) Optimize the Garbage Collector to reduce the time when the garbage collection results in no response from the application.
For (1), add the following parameters:
-XX: + disableexplicitgc
For (2), the startup speed will be affected, but because eclipse runs for a long time, this optimization is necessary:
-XX: compilethreshold = 100 (how many times a method is called will be compiled with the local machine code)

We can see that the number and time of compilation methods increase significantly.
For (3), the CMS collector should be better than the serial collector. Add the following parameters:
-XX: + useparnewgc
-XX: + useconcmarksweepgc
-XX: cmsinitiatingoccupancyfraction = 80
So far, optimization has ended


The added parameters are summarized as follows:
-Verbose: GC
-XX: + printgcdetails
-XX: + printgcdatestamps
-Xloggc: D:/soft/eclipse-jee-galileo-win32/Eclipse/GC. Log
-Xms512m
-Xmx512m
-XX: newsize = 256 m
-XX: maxnewsize = 256 m
-XX: permsize = 96 m
-XX: maxpermsize = 96 m
-XX: + disableexplicitgc
-XX: compilethreshold = 100
-Xverify: None
-XX: + useparnewgc
-XX: + useconcmarksweepgc
-XX: cmsinitiatingoccupancyfraction = 80

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.