Eclipse 4.2.0 / debugger非常缓慢

3

升级到Eclipse 4.2.0版本后,调试器似乎无响应或者非常慢。我的Java版本与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)`

还有其他人遇到了同样的问题吗?

编辑:我有太多(旧的)断点(也许特别是在检查和未经检查的异常上的断点特别耗费资源;-))


你使用的是哪个Eclipse软件包?是专门用于Java开发者的Eclipse吗? - Paul Webster
3个回答

5

我不知道如何加速Eclipse中的调试,但是有一些通用规则可以帮助你加速整个Eclipse:

  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 -m n:
    

    Then you should format the ram disk manually.

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

    imdisk -D -m n:
    
  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.


你确定要使用JDK吗?我曾经在Ubuntu上使用OpenJDK,因为它是默认的选择,而Oracle JDK由于许可问题无法提供。 - Johannes
1
使用 Eclipse 3.7 和 4.2 调试项目有着天壤之别。在简单的代码行上,例如日志记录语句,步进几秒钟才能完成。然而,在3.7中,几乎是瞬间完成。 - varikin

4

检查您是否有任何方法断点。它们可能会非常缓慢。


0

在调试时,请确保清除表达式窗口中的所有表达式。仅在需要时添加表达式,并在使用后将其删除。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接