简体   繁体   English

Eclipse Luna 需要很长时间才能保存一个 xml 文件:(

[英]Eclipse Luna takes a long time saving an xml file :(

About a month ago I went from Windows to a MacBook Pro.大约一个月前,我从 Windows 转到了 MacBook Pro。 Same Eclipse version, (almost) same settings, but it frustrates me that saving an xml file takes about 10s :(... Even if I just delete/add a space char.相同的 Eclipse 版本,(几乎)相同的设置,但让我感到沮丧的是,保存一个 xml 文件大约需要 10 秒 :(...即使我只是删除/添加一个空格字符。

I have a lot of files, about 10 projects opens in Eclipse but my old Windows box with an old quad core (not even an i7) had no problems with this.我有很多文件,在 Eclipse 中打开了大约 10 个项目,但我的旧四核(甚至不是 i7)的旧 Windows 机器对此没有任何问题。

I know this is a knows problem in Eclipse and I had it in the past as well, but it was solved after a few upgrades in the past.我知道这是 Eclipse 中的一个已知问题,过去我也遇到过,但在过去几次升级后解决了。

Currently I run on the latests Luna version, with up2date plugins, tried a lot of possible solution, most from SO, but still not solved.目前我在最新的 Luna 版本上运行,带有 up2date 插件,尝试了很多可能的解决方案,大多数来自 SO,但仍未解决。 Please some help.请一些帮助。

I am using EE Eclipse to mainly develop java web apps and use the following plugins: AspectJ (with Xref), EGit, JGit, CheckStyle, Maven, TestNG.我使用 EE Eclipse 主要开发 java web 应用程序并使用以下插件:AspectJ(带外部参照)、EGit、JGit、CheckStyle、Maven、TestNG。 All files are stored as UTF-8所有文件都存储为 UTF-8

Editing the xml file is slow in both the text and the xml editor.在文本和 xml 编辑器中编辑 xml 文件都很慢。 It concerns xml files that are located in a java package (in the /src/main/java/ folder).它涉及位于 java 包中的 xml 文件(在 /src/main/java/ 文件夹中)。

The strange thing is that Editing an xml file in a project-root subfolder isn't slow, like: project-root/test-output/bla.xml (works well in both the text and xml editor)... weird... Both files (the slow and fast save one) are part of version control and used by Git.奇怪的是,在 project-root 子文件夹中编辑 xml 文件并不慢,例如:project-root/test-output/bla.xml(在文本和 xml 编辑器中都运行良好)...很奇怪.. . 这两个文件(慢速保存和快速保存)都是版本控制的一部分,由 Git 使用。

In case I copy the slow file to the folder project-root/test-output/, it's also saved fast :(如果我将慢速文件复制到文件夹 project-root/test-output/,它也会快速保存:(

Renaming the slow file such that it has the "txt" extension and editing with the text editor has not effect.重命名慢文件使其具有“txt”扩展名并使用文本编辑器进行编辑无效。

I thought it is caused by some builder that works only on the java source folder... The project has a Java and Maven builder.我认为这是由某些仅适用于 java 源文件夹的构建器引起的......该项目有一个 Java 和 Maven 构建器。 Disabling them has no effect.禁用它们没有任何效果。

The Eclipse log file doesn't contain any relevant exception. Eclipse 日志文件不包含任何相关异常。 It contains some key-binding exceptions and resource tree locked modifications, but these exceptions are old.它包含一些键绑定异常和资源树锁定修改,但这些异常是旧的。

What I tried (what I can remember): + Disabled all validation (especially the xml validation), for all projects.我尝试过的(我记得的): + 禁用所有项目的所有验证(尤其是 xml 验证)。 + Ensure all latest updates are installed of all plugins, including the EGit plugin. + 确保安装了所有插件的所有最新更新,包括 EGit 插件。 + Disabled Checkstyle. + 禁用 Checkstyle。 + ... + ...

Any ideas as I am getting a bit frustrated about this?我对此感到有点沮丧有什么想法吗?

A poor-man's solution may be in穷人的解决办法可能是

  1. switch to a empty workspace ( workspace2 in example)切换到一个空的工作区(例如workspace2
  2. create a new pde-plugin-project ( mytestplugin in example)创建一个新的mytestplugin -plugin-project(例如mytestplugin
  3. debug the mytestplugin means you debug a instance of eclipse too, so use the workspace you usually work with in the debugging-second-eclipse.调试mytestplugin意味着您mytestplugin调试 eclipse 的一个实例,因此请使用您通常在调试第二个eclipse 中使用的工作区。
  4. Now: save the xml-file in the debugging-second-eclipse with the workspace you usually work with, quick jump to the first eclipse and press "pause" to stop the second-eclipse.现在:使用您通常使用的工作区将 xml 文件保存在调试第二次日食中,快速跳转到第一个日食并按“暂停”停止第二次日食。
  5. inspect the compleate debug-stacktrace-thread-tree in the debug view (please post the image as a comment here).在调试视图中检查完整的调试堆栈跟踪线程树(请在此处发布图像作为评论)。

Regards问候

When Trying the solution of @Peter I noticed that the workspace I was using was located in the "eclipse.app" file like this:在尝试@Peter 的解决方案时,我注意到我使用的工作区位于“eclipse.app”文件中,如下所示:

/Applications/eclipse/Eclipse.app/Contents/MacOS/D:\\Users\\Ed\\Develop\\Projecten\\EclipseWorkSpace/ /Applications/eclipse/Eclipse.app/Contents/MacOS/D:\\Users\\Ed\\Develop\\Projecten\\EclipseWorkSpace/

No idea why/how this happened.不知道为什么/如何发生这种情况。 However, I moved this workspace to a "normal" directory in my home folder, and how saving an xml file work normal, fast as expected... No idea why having the workspace located in the eclipse.app made it slow, but it works ...但是,我将此工作区移动到我的主文件夹中的“普通”目录,以及如何保存 xml 文件正常工作,按预期快速......不知道为什么将工作区放在 eclipse.app 中使它变慢,但它作品...

Open eclipse.ini.打开 eclipse.ini。 Increase -Xms, -Xmx This works for me.增加 -Xms, -Xmx 这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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