java Intellij IDEA 12 响应慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14173637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 15:21:16  来源:igfitidea点击:

Intellij IDEA 12 slow response

javaintellij-idea

提问by Gelin Luo

I've upgraded to IDEA 12 and become frustrated with the slow response. Class navigation takes several seconds to populate the search list (previously it was instantly), any dialog relevant to file list operation hangs for minutes. Move a class to another package just hang up and I have to kill the process. Does anyone have the same experience with me?

我已经升级到 IDEA 12 并且对缓慢的响应感到沮丧。类导航需要几秒钟来填充搜索列表(以前是即时的),任何与文件列表操作相关的对话框都会挂起几分钟。将一个类移到另一个包中,只需挂断即可,我必须终止该进程。有没有人跟我有同样的经历?

Additional information:

附加信息

  • I am on windows 7
  • I tried both 64 and 32 versions and both have the same issue
  • My 64bit vmoption file has the following configuration:
  • 我在 Windows 7
  • 我尝试了 64 和 32 版本,都遇到了同样的问题
  • 我的 64 位 vmoption 文件具有以下配置:

enter image description here

在此处输入图片说明

  • I have the log dir zipped and put on http://ge.tt/1JwgAnU/v/0. When I start to generating the log dir, I clean it first and then start IDEA 64 bits, open a project (automatically), then invoke File > import module command. I observed there are around a minutes delay before the dialog popped up. And inside the log dir I see a threadDumps-20130106-091041-IU-123.100folder. However there is no exception found in the idea.log file.
  • 我将日志目录压缩并放在http://ge.tt/1JwgAnU/v/0 上。当我开始生成日志目录时,我先清理它,然后启动 IDEA 64 位,打开一个项目(自动),然后调用文件 > 导入模块命令。我观察到在弹出对话框之前有大约一分钟的延迟。在日志目录中,我看到一个threadDumps-20130106-091041-IU-123.100文件夹。但是,idea.log 文件中没有发现异常。

Updates

更新

A screenr showing IDEA hang up when trying to move one class to another package by drag and drop: http://www.screenr.com/zlA7

当试图通过拖放将一个类移动到另一个包时,显示 IDEA 挂断的筛选器:http: //www.screenr.com/zlA7

回答by Gelin Luo

I found the problem is caused by JDK 8 ea installed in my windows 7. IDEA use exe4j to load JDK, which automatically picked up JDK 8 (See this question).

我发现问题是由安装在我的 windows 7 中的 JDK 8 ea 引起的。IDEA 使用 exe4j 加载 JDK,它自动选择了 JDK 8(请参阅此问题)。

After I defined IDEA_JDK_64environment variable and point that to my JDK 6, a high performance IDEA comes back!

在我定义IDEA_JDK_64环境变量并将其指向我的 JDK 6 之后,一个高性能的 IDEA 回来了!

回答by tntim96

I had the exact same, but solved it by changing a setting the idea64exe.vmoptions: from... -XX:ReservedCodeCacheSize=64m...to... -XX:ReservedCodeCacheSize=256m

我有完全相同的,但通过更改idea64exe.vmoptions的设置解决了它:从... -XX:ReservedCodeCacheSize=64m...到... -XX:ReservedCodeCacheSize=256m

回答by Andrew Mao

I had this problem with RubyMine (uses the same codebase) and it was because my system had swiched to OpenJDK instead of Sun/Oracle JDK.

我在使用 RubyMine(使用相同的代码库)时遇到了这个问题,这是因为我的系统切换到 OpenJDK 而不是 Sun/Oracle JDK。

I see that someone had similar problems in this thread: OpenJDK or Sun Java for IntelliJ IDEA

我看到有人在这个线程中遇到了类似的问题:OpenJDK 或 Sun Java for IntelliJ IDEA

Specifically, do you see something like the following when you start your IDE from the terminal?

具体来说,当您从终端启动 IDE 时,您是否看到类似以下内容?

OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b24~pre2-1)
OpenJDK Server VM (build 20.0-b12, mixed mode)
WARNING: You are launching IDE using OpenJDK Java runtime.

 THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS!

 NOTE:    If you have both Oracle (Sun) JDK and OpenJDK installed
          please validate either IDEA_JDK, JDK_HOME, or JAVA_HOME environment          variable points to valid Oracle (Sun) JDK installation.
          See http://ow.ly/6TuKQ for more info on switching default JDK

 Press Enter to continue.

Perhaps you should check if the upgrade caused the IDE to revert to a non-Oracle JDK.

也许您应该检查升级是否导致 IDE 恢复为非 Oracle JDK。

回答by Danilo Bargen

In my case it was a Findbugs plugin that caused frequent lags. You can see this if you run IDEA from the terminal and look at the log output, e.g.

就我而言,它是导致频繁滞后的 Findbugs 插件。如果从终端运行 IDEA 并查看日志输出,则可以看到这一点,例如

No classfiles specified; output will have no warnings

未指定类文件;输出将没有警告

After disabling the real-time Findbugs scans (Settings -> Inspections -> Findbugs IDEA) everything ran smoothly again.

禁用实时 Findbugs 扫描(设置 -> 检查 -> Findbugs IDEA)后,一切再次顺利运行。