Archive for the 'Eclipse' Category

31st Aug 2008

Tweaking Eclipse

Eclipse is a very powerful editor, but let’s face it. It can be slow. Recently I have been doing some research into some ways I can get the thing to speed up a little and I thought I would share what I have found. As it turns out, the most detailed description I have found is in a book I own on Flex –
Flex Solutions : Essential Techniques for Flex 2 and 3 Developers by Marco Casario. It basically mirrors the resources I found online, but has more details in regards to what settings to try for particular amounts of memory.

In order to apply some of these tweaks, you will be editing the INI file for Eclipse. This file is named eclipse.ini and can be found in the root directory of wherever you installed Elcipse (e.g., C:\Program Files\eclipse).

Lets start with those tweaks first and then move on to some of the other settings you can play with once you have Eclipse open.

Once you have located the eclipse.ini, make a back up copy of it in case you need to reference to your original settings. Once you have done that, open elcipse.ini in you text editor of choice.

The default contents of my ini file looked like this:

-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx256m

We are interested in the stuff after the -vmargs. These are the arguments that Eclipse passes to the Java Virtual Machine. By tweaking these settings, we can do things like manage the amount of memory allocated to Eclipse. To apply the tweaks, we are going to modify some of the existing arguments and add a few new ones. For the ones we add, place them at the end of the file after the -vmargs flag. If you are interested in what the specific arguments mean, go here as I am not going to go into that level of detail.

Here are the recommended settings by amount of RAM.

512 MB RAM:

-Xms256m
-Xmx256m
-XX:PermSize=128m
-XX:MaxPermSize=128m

1 GB RAM

-Xms512m
-Xmx512m
-XX:PermSize=256m
-XX:MaxPermSize=256m

2 GB RAM

-Xms1024m
-Xmx1024m
-XX:PermSize=512m
-XX:MaxPermSize=512m

Save the file.

Now we can move onto some of the things you can do once you have eclipse open.

Those of you who use Eclipse know that it has a good error checking system. However, that robustness comes at the cost of speed. Once of the things that Eclipse does is scans through the workspace to check for errors. If you have a large workspace with a lot of projects this can take quite some time. To keep Eclipse from doing this scan each time you save a file, disable the Build Automatically option (Window>>Preferences>>Workspace). If you need error checking, you can turn it back on right before you are going to do a release.

Once of the other things you can do is close any projects that you are not using. That way Eclipse does not have to keep track of them.

Finally, we can apply the same idea to files. For each file that you have open, Eclipse has to track it an allocate memory. Close files that you are not working on and as a further step you can actually limit the number of files that Eclipse will allow you to have open in the preferences dialog (Window >> Preferences >> General >> Editors)

Posted by Posted by Jeremy Wischusen under Filed under Eclipse Comments No Comments »

08th Aug 2008

Word Completion in Eclipse

For a long time I used IDEs such as SEPY and Flashdevelop, however, when I work on my MAC or Linux systems, I do not have these available to me and I have yet to find a full satisfactory replacement. One of the features I love about those editors is that when I define  a variable in a file, it then becomes available in the auto-completion feature. This was great as I did not have to constantly type out all of the variables and methods I defined.

The other day I was doing some research on Eclipse for an article I am writing and discovered that Eclipse has a word completion feature. If you start typing something and then press Alt+/ Eclipse will present you with an auto-complete box with all the words that start with what you have type, or if there is only one match, it will insert it.

While this is not quite as nice as the features in SEPY and Flashdevelop, it is definitely a time saver. Additionally, since this is an Eclipse feature, it works with all sorts of file types.

Definitely a feature worth knowing about.

Posted by Posted by Jeremy Wischusen under Filed under Eclipse Comments No Comments »