Birrel
Birrel

Reputation: 4834

Why does the Eclipse Android IDE get so slow and laggy after only a small amount of use?

I am using the Eclipse Android IDE, downloaded from the Android site (ADT v22.6.2, Mac, OS X).

When I first launch the program, it is quick to open new files and make modifications, but very rapidly slows down and becomes quite laggy. Opening project files becomes so slow that one wonders if the IDE crashed or froze-up. Editing said project files is equally painful...

For example, clicking into a non-fucused window/tab to insert the cursor takes a solid 5-10 seconds or more of delay before it appears and modifications can be made, and saving files can take up to 10 seconds or more (for a single file).

Why is this? Why does it start off nice and quick, but so rapidly degrade in performance? Restarting ADT will bring the speed up a bit, but each successive launch of it brings the overall performance down to the point where only restarting the computer can bring it back up.

I've had similar issues back when I was coding in MatLab and using their WYSIWYG GUI builder. Eventually the system got bogged down with all the components being drawn on the screen that it would freeze up and you'd have to restart the software (and sometimes the computer).

Eclipse is very powerful, and I'd be lost without it, but it would be nice to maintain consistent performance from it without multiple software and system restarts. Is there a fix, or is everyone succumbing to the same problem?

Upvotes: 1

Views: 549

Answers (2)

Stephen C
Stephen C

Reputation: 719426

The only way to be sure is to actually look at your system, but I suspect that the cause is that Eclipse's heap is too small. That will cause two things to happen:

  • It will run the GC frequently, and that will directly cause it to be laggy.

  • The fact that Eclipse is short of memory means that it is likely that cached information about (for example) code that you are currently looking at will need to be discarded. Then when you next need that information, Eclipse will need to reload or recalculate it ... contributing to lagginess.

The cure this is to change Eclipse's heap size.

Reference:

Upvotes: 1

Devraj
Devraj

Reputation: 1531

hmmm... So you can do

  1. disable the Android Package Builder (right-click on project#Properties#Builders) use ant for build and deployment of apk.

    see android-workaround-for-slow-building-workspace-problem-in-eclipse for details

2.ADT 21 pre-dex all libraries. This means regular compilation only re-dex the output of your project (faster) and then merges the result with the pre-dexed libraries (pretty quick).

Upvotes: 2

Related Questions