Eclipse, go faster!

My university’s CSE program had two favorite dev tools:  Eclipse or emacs (which was later replaced with your text editor of choice :)).  You could tell me I should switch to IntelliJ, but being not that far removed from college, I’m just not ready.

Anyway, recently I found this blog to be helpful in improving Eclipse performance.  Take a look at what might apply to you given your environment.

If you’re looking to tweak HotSpot JVM options (those prefaced with -X in your eclipse.ini), the author references options specific to <= JDK 7.  Options which are specific to JDK 8 are located here.

Here is an abstraction of what we’re looking at in memory.  I’m keeping it generic since this varies based on the implementation/JDK (i.e., PermGen in non-heap (pre-JDK 8) vs.  Metaspace in non-heap (JDK 8)).

jvm

 

Typically, when tweaking the memory pool / heap, these are the options we worry about:

-Xmn: (n)ursery size — this part of the heap is for younger objects (recommended ~Xmx/2 or ~Xmx/4)
-Xms: (s)tart size — initial size of heap (1024X and > 1 MB.  default value is Xmn + size of nursing home)
-Xmx: (m)a(x) size — entire size of memory pool (1024X and > 2 MB)

-Xmn1024m
-Xms1024m
-Xmx2048m

Oracle recommends setting the nursery to the max heap size / (2 or 4) as this is where garbage collection tends to occur.  If the nursery is too small, only smaller objects will get collected and they will get collected very frequently.  If the nursery is too large, the collector will only cleanup large objects (and take its time doing so).

Feel free to comment if you have any additional suggestions!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s