简体   繁体   中英

Eclipse 4.2.0 / debugger very slow

After switching to Eclipse 4.2.0 the debugger seems to be not responable or very very slow. My used Java version is (same as used in Eclipse):

johannes@luna:~/sirix$ java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)`

Anyone else encountered the same behavior?

Edit: I have had too many (old) breakpoints (maybe especially breakpoints on checked and unchecked exceptions are especially costly ;-))

I don't know about how to speed up the debugging in Eclipse, but there are some general rules you can follow to speed up Eclipse on a whole:

  1. Disable antivirus software, or add your JDK & eclipse & workspace & other related folder to white list in your antivirus software.

  2. Disable unnecessary validations and startup action in Eclipse reference.

    For validations: on Eclipse menu Windows -> Preferences -> Validation, click “Disable All”, and then select the validator which you need. I selected “Classpath Dependency Validator” only.

    For startup action: on eclipse menu Windows -> Preferences, type “startup”, select “Startup and Shutdown”, untick the options you don't need. (Thanks for David's suggest, I've added the above 2 detail steps for readers)

  3. Modify eclipse.ini to set the Xmn(new generation size), Xms and Xmx, enable parallel GC

     -vm C:/jdk1.6.0_25/bin -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar –launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502 -product org.eclipse.epp.package.jee.product –launcher.defaultAction openFile –launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform –launcher.XXMaxPermSize 256m –launcher.defaultAction openFile -vmargs -server -Dosgi.requiredJavaVersion=1.5 -Xmn128m -Xms1024m -Xmx1024m -Xss2m -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+UseParallelGC 
  4. Create a ram disk(virtual disk) on memory, and put your jdk on the ram disk. You can use imdisk to create ram disk. Firstly download it from: http://www.ltr-data.se/opencode.html/#ImDisk , and install it.

    Then set the ImDisk driver to auto-load at Command Prompt with administrative privileges (for example right-click, start as Administrator), type:

     sc config imdisk start= auto net start imdisk 

    Create a 200m ram disk as driver n by:

     imdisk -a -t vm -s 300m -mn: 

    Then you should format the ram disk manually.

    Later, if you would like to remove the ram disk, just run the command:

     imdisk -D -mn: 
  5. Make sure you are using Sun JDK, not open JDK/GCJ nor other JDK on Linux. If you are not satisfied with the after the above steps, install jRockit instead of Sun JDK, and change some of the VM options by jRocket specification, jRockit is faster than Sun JDK.

Check that you don't have any method breakpoints. Those can be incredibly slow.

Make sure you clear all the expression in the Expression window when debugging. Add expressions only when u require and remove after use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM