Eclipse 3.5(和更新版本)切换标签很慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1046887/
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-09-19 13:49:53  来源:igfitidea点击:

Eclipse 3.5 (and newer) switching tab is very slow

javaeclipsemacos

提问by n179911

I am using eclipse 3.5 (cocoa build) on Macos 10.5 with Java 1.5.0.19.

我在 Macos 10.5 和 Java 1.5.0.19 上使用 eclipse 3.5(cocoa build)。

I just have 3 java files opened 1 files ~ 2000 lines the other 2 are ~ 700 lines.

我只打开了 3 个 java 文件,其中 1 个文件 ~ 2000 行,其他 2 个 ~ 700 行。

But when I switch from 1 file tab to another, eclipse takes a long time (~ 20 seconds) to switch to another tab.

但是当我从 1 个文件选项卡切换到另一个时,eclipse 需要很长时间(~ 20 秒)才能切换到另一个选项卡。

I have already change the eclipse.ini to

我已经将 eclipse.ini 更改为

more eclipse.ini
-startup
../../../plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.0.0.v20090519
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=512m
-Xms128m
-Xmx1024m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

Is there any way to make eclipse 3.5 more speedy?

有什么方法可以使 eclipse 3.5 更快?

Thank you.

谢谢你。

回答by Mike Miller

I switched this line in the eclipse.ini file (found inside the eclipse application package):

我在 eclipse.ini 文件中切换了这一行(在 eclipse 应用程序包中找到):

-Dosgi.requiredJavaVersion=1.5

to

-Dosgi.requiredJavaVersion=1.6

and tab switching was speedy again.

并且标签切换再次快速。

回答by zvikico

Go with the 32-bit Cocoa release. The 64-bit won't help IMHO. It really works great on my 2.4 GHz MBP. I usually have about 30 files open, some fairly large, never experienced what you describe.

使用 32 位 Cocoa 版本。恕我直言,64 位将无济于事。它在我的 2.4 GHz MBP 上真的很好用。我通常打开大约 30 个文件,其中一些相当大,从未经历过您所描述的。

Try to get a new plain-vanilla 32-bit Cocoa distro, don't modify anything and check if there's an issue. It could be a rogue plugin, too. Do you have any installed?

尝试获得新的普通 32 位 Cocoa 发行版,不要修改任何内容并检查是否存在问题。它也可能是一个流氓插件。你有安装吗?

Check you heap status. Open the Eclipse preferences, in the very first preferences page there's a "show heap status" option. You might be running low on memory. Check the swap status of your machine using the activity monitor - if it swaps a lot I'd recommend shutting down other applications. In general, I recommend 4 GB RAM for development machines.

检查您的堆状态。打开 Eclipse 首选项,在第一个首选项页面中有一个“显示堆状态”选项。您可能内存不足。使用活动监视器检查机器的交换状态 - 如果它交换很多,我建议关闭其他应用程序。一般来说,我建议开发机器使用 4 GB RAM。

回答by user1692511

I know this is kind of late to the game, but I found that changing the permissions to ~workspace.metadata.plugins\org.eclipse.e4.workbench to deny myself access stopped the slow-down issue.

我知道这对游戏来说有点晚了,但我发现将权限更改为 ~workspace.metadata.plugins\org.eclipse.e4.workbench 以拒绝自己访问阻止了速度变慢的问题。

Seems that Eclipse (4.2.0) writes out a corrupt settings file every so often, and when it's loaded in at startup again it slows everything down as it's constantly throwing errors internally. Changing the security on that directory so that Eclipse can't write to it is a kind of "fix"! It does mean that each time Eclipse is started it's back to its default settings, but if speed is more important, I think it's a worthwhile sacrifice.

似乎 Eclipse (4.2.0) 每隔一段时间就会写出一个损坏的设置文件,当它在启动时再次加载时,它会减慢一切,因为它不断地在内部抛出错误。更改该目录的安全性以便 Eclipse 无法写入它是一种“修复”!这确实意味着每次启动 Eclipse 时它都会恢复到它的默认设置,但如果速度更重要,我认为这是一个值得的牺牲。

回答by broc.seib

There are now patches for Juno to begin addressing this issue. See comment #212 on bug 385272for information on how to update your installation. If you wait a little longer you should find these fixes in the Kepler milestone on 12/21/2012.

Juno 现在有补丁可以开始解决这个问题。有关如何更新安装的信息,请参阅关于错误 385272 的评论 #212。如果您再等一会儿,您应该会在 2012 年 12 月 21 日的开普勒里程碑中找到这些修复程序。

(I believe the other suggestions posted here, e.g. increasing memory or tweeking various startup params or prefs might have some positive effect on performance, but the underlying problem is threads run amok as described in the bug report.)

(我相信这里发布的其他建议,例如增加内存或调整各种启动参数或首选项可能对性能有一些积极的影响,但潜在的问题是线程运行异常,如错误报告中所述。)

回答by Jeff

This might be the bug that was referred to. https://bugs.eclipse.org/bugs/show_bug.cgi?id=282229

这可能是提到的错误。https://bugs.eclipse.org/bugs/show_bug.cgi?id=282229

回答by jimmy

switching to 1.6 really helps. This is the link to locate eclipse.ini file for mac http://wiki.eclipse.org/Eclipse.ini

切换到 1.6 确实有帮助。这是为 mac http://wiki.eclipse.org/Eclipse.ini找到 eclipse.ini 文件的链接

回答by broc.seib

This eclipse bug report is spot-on with the behavior you describe. (I had the same experience using a new Juno installation on a beefy XP machine.)

此 Eclipse 错误报告与您描述的行为一致。(我在强大的 XP 机器上使用新的 Juno 安装也有同样的体验。)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272

https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272

The most useful part of the bug report was in comment 29, which suggests creating a new workspace. The easiest way to do this is:

错误报告中最有用的部分是在评论 29 中,它建议创建一个新的工作区。最简单的方法是:

1) exit eclipse

2) rename .../path/to/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi (e.g., append ".old")

3) start eclipse

1)退出日食

2)重命名.../path/to/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi(例如,附加“.old”)

3)开始日食

I believe changing -Dosgi.requiredJavaVersion=1.5 to 1.6 may help only incidentally, if at all.

我相信将 -Dosgi.requiredJavaVersion=1.5 更改为 1.6 可能只是偶然地有所帮助,如果有的话。

回答by msEmmaMays

Increase the memory limits in eclipse.ini seems to have fixed this for me - not sure if it will stay fixed though

增加 eclipse.ini 中的内存限制似乎已经为我解决了这个问题——但不确定它是否会保持固定

FROM:

从:

-vmargs
-Xms40m
-Xmx512m

TO

-vmargs
-XX:MaxPermSize=512m
-Xms256m
-Xmx784m

ALSO - if you came from aptana3 and imported your project - You need to do this

另外 - 如果你来自 aptana3 并导入了你的项目 - 你需要这样做

  1. Click Project Properties
  2. Go to "Builders"
  3. Make sure there are no "Missing Builders" If there are, uncheck them - I had two left over from aptana when I imported my project (com.aptana.ide.core.unifiedBuilder AND com.aptana.editor.php.aptanaPhpBuilder)
  1. 单击项目属性
  2. 进入“建设者”
  3. 确保没有“缺少的构建器”如果有,请取消选中它们 - 当我导入我的项目时,我从 aptana 中剩下两个(com.aptana.ide.core.unifiedBuilder AND com.aptana.editor.php.aptanaPhpBuilder)

---- UPDATE ----

- - 更新 - -

It was fixed - but not for the reasons I thought. My SVN was no longer recognized by eclipse. As soon as I hit 'share with team' and reconnected it the tab-switching issues reappeared.I'm going to try and figure out if It's an svnKit vs JavaHL problem - I'm not sure which connector I picked when I setup eclipse this time.

它是固定的 -但不是因为我想的原因。我的 SVN 不再被 eclipse 识别。一旦我点击“与团队共享”并重新连接,选项卡切换问题就会再次出现。我将尝试弄清楚这是否是 svnKit 与 JavaHL 的问题 - 我不确定这次设置 eclipse 时我选择了哪个连接器。

If you want confirm this is your issue trying disconnecting from the SVN (Team->disconnect) and restarting eclipse

如果您想确认这是您尝试与 SVN 断开连接(团队->断开连接)并重新启动 eclipse 的问题

回答by Arjan Tijms

I can now more or less confirm that the problem is really with Eclipse 3.5.

我现在或多或少可以确认问题确实出在 Eclipse 3.5 上。

I've run Eclipse on a much more powerful Mac, a 27" core I7, 2.93Ghz with 8GB ram and a SSD running OS X 10.6.4. Initially this was extremelysmooth and snappy, but after an up time of a dozen hours or so, Eclipse suddenly began to slow-down again. I had very little to almost nothing running in the background. Just Eclipse (32 bits, given it 1.5GB memory), JBoss AS and Safari.

我在功能更强大的 Mac、27" 核心 I7、2.93Ghz 和 8GB 内存和运行 OS X 10.6.4 的 SSD 上运行 Eclipse。最初这非常流畅和活泼,但经过十几个小时的正常运行大约这样,Eclipse 突然又开始变慢了。我在后台几乎没有运行。只有 Eclipse(32 位,给它 1.5GB 内存)、JBoss AS 和 Safari。

A simple tab switch would take a few seconds and meanwhile I noticed the CPU load on one core going to 100%. The same happened with switching perspectives and various other operations.

一个简单的选项卡切换需要几秒钟,同时我注意到一个核心上的 CPU 负载将达到 100%。切换视角和其他各种操作也是如此。

When I restarted only Eclipse, everything was completely fast again. This happened a couple of times.

当我只重新启动 Eclipse 时,一切又变得非常快。这发生了几次。

回答by Arjan Tijms

I experience the same issue using OS X 10.5.7 and Eclipse 3.5.2 on a fairly low end machine (early 2006 iMac with 1.5GB). Right after I start my machine however, everything is really snappy. I can even launch JBoss AS and there is still no slow-down. I monitor "Swap used" in activity monitor, and it stays at 0 bytes swap used.

我在相当低端的机器(2006 年初的 iMac,1.5GB)上使用 OS X 10.5.7 和 Eclipse 3.5.2 时遇到了同样的问题。然而,在我启动我的机器之后,一切都非常活泼。我什至可以启动 JBoss AS 并且仍然没有减速。我在活动监视器中监视“使用的交换”,它保持在 0 字节交换使用。

Then, I launch something else, like iTunes and mail or switching to another account.

然后,我启动其他东西,例如 iTunes 和邮件或切换到另一个帐户。

Things become slow then, which is expected, and I see "Swap used" increasing. Eclipse slows down to a crawl, and working with it is near to impossible.

然后事情变得缓慢,这是意料之中的,我看到“使用的交换”在增加。Eclipse 慢得像爬行一样,使用它几乎是不可能的。

Then I logout the other account, close down all other apps that I opened, so the state of my machine is basically the same again as when it was still fast. BUT... it stays dog slow! Even though I closed all the other apps, "Swap used" in activity monitor only decreases a little (from ~1.2GB to ~700MB). Just switching tabs between 2 very simple Java files takes up to 20 seconds, meanwhile I see in activity monitor that the CPU usage goes up to a solid 100%.

然后我注销另一个账户,关闭我打开的所有其他应用程序,这样我的机器的状态又和它仍然很快的时候基本一样了。但是......它保持狗慢!即使我关闭了所有其他应用程序,活动监视器中的“使用的交换”也只减少了一点(从 ~1.2GB 到 ~700MB)。仅在 2 个非常简单的 Java 文件之间切换标签最多需要 20 秒,同时我在活动监视器中看到 CPU 使用率高达 100%。

There definitely is something strange going on here. This does not seem like normal behavior. It is as-if Mac OS X goes into a 'slow mode' when I demand too much resources from it, but when the resources are there again it fails to recover.

这里肯定有什么奇怪的事情发生。这似乎不是正常行为。就好像 Mac OS X 在我需要太多资源时进入“慢速模式”一样,但是当资源再次出现时它无法恢复。

Highly annoying!

非常烦人!

If I reset the machine and open the exact same working set again (Eclipse with the same 2 files open, JBoss AS started in debug mode, Safari with 1 window) everything is really fast again.

如果我重置机器并再次打开完全相同的工作集(Eclipse 并打开相同的 2 个文件,JBoss AS 以调试模式启动,Safari 带有 1 个窗口),一切都会再次变得非常快。