优化Eclipse进行Android开发Eclipse、Android

2023-09-04 08:41:33 作者:深藍的海將我淹沒、

我开发使用Eclipse和ADT插件机器人......这是......慢。

I develop Android using Eclipse and the ADT plug-in... and it's... slow.

我要经常重新启动,它变得更糟糕的痛苦时,我有不同的Andr​​oid项目开(必要时我使用的库项目)。

I have to restart frequently and it gets painfully worse when I have various Android projects open (needed for when I use library projects).

是否有任何特定的优化,​​我可以做,以提高性能的Eclipse使用ADT插件时?

Are there any specific optimizations that I can make to improve Eclipse performance when using the ADT plug-in?

推荐答案

首先确保你有一个相当最新版本的Java和Eclipse和ADT插件。尤其是爪哇​​。

First make sure you have a fairly recent version of Java and Eclipse and the ADT plug-ins. Especially Java.

然后关闭Eclipse,并期待在您安装了Eclipse的目录。看到一个名为的eclipse.ini有文件吗?做一个备份,然后在文本编辑器中打开它。看最后几行。你会看到类似下面的内容:

Then close Eclipse and look at the directory where you installed Eclipse. See a file called eclipse.ini there? Make a backup copy, then open it in a text editor. Look at the last few lines. You'll see something similar to the following:

--launcher.XXMaxPermSize
512m
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jdk1.6.0_24/bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx2g

如果它看起来并不完全一样,并没有改变任何东西,除了我将要描述的选项不要担心。每个选项开始在自己的行不带空格。

Don't worry if it doesn't look exactly like that, and don't change anything except the options I'm about to describe. Each option starts on its own line with no white space.

对于性能的重要的部分是最大永久代大小选项,设置这两条线(即必须出现-vmargs前):

The important parts for performance are the max permanent generation size option, set with these two lines (that must appear before -vmargs):

--launcher.XXMaxPermSize
512m

我建议256米如果你有2G还是真正的4G内存,或者512米如果你有更多。接下来,最小内存选项,设置这一行(必须出现-vmargs后):

I recommend 256m if you have 2g or 4g of real memory, or 512m if you have more. Next, the minimum memory option, set with this line (must appear after -vmargs):

-Xms512m

我推荐这被设置为同样的事情,你的最大烫发大小选项。最后,还有,其控制的内存,Eclipse将能够使用的总量(必须出现-vmargs后)的选项,在这条线设置:

I recommend this be set to the same thing as your max perm size option. Finally, there's the option that controls the total amount of memory that Eclipse will be able to use, set on this line (must appear after -vmargs):

-Xmx2g

我推荐设置到1G,如果你有2-4G的实际内存和2G,如果你有更多的。

I recommend this be set to 1g if you have 2-4g of real memory, and 2g if you have more.

保存文件并重新启动Eclipse。您可能需要调整设置向上或向下查找您系统的最佳值,但上述建议是一个很好的起点。

Save the file and restart Eclipse. You may have to adjust the settings up or down to find the optimum value for your system, but the recommendations above are a good starting point.