1

Recently I bought a good computer with processor i5 3570k and 16GB of RAM, I wonder if there's a way to increase my Eclipse and Glassfish speed, to they can work together to startup and do the hot deploy while I'm developing my applications.

This is my eclipse.ini

-nosplash
-vmargs
-Xincgc
-Xss500k
-Dosgi.requiredJavaVersion=1.6
-Xms512m
-Xmx1024m
-XX:NewSize=8m
-XX:PermSize=1024m
-XX:MaxPermSize=1024m
-XX:MaxPermHeapExpansion=10m
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=70
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseParNewGC
-XX:+CMSConcurrentMTEnabled
-XX:ConcGCThreads=2
-XX:ParallelGCThreads=2
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:CMSIncrementalDutyCycle=5
-XX:GCTimeRatio=49
-XX:MaxGCPauseMillis=20
-XX:GCPauseIntervalMillis=1000
-XX:+UseCMSCompactAtFullCollection
-XX:+CMSClassUnloadingEnabled
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+AggressiveOpts
-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

Any recommendations about it ?

4 Answers 4

4

Eclipse and Glassfish are just containers, their tuning depends heavily on how you use them (number of projects in eclipse, number of apps in glassfish, ...). However, I see some weird JVM options in your eclipse.ini. Here are the ones I would simply remove :

  • -Xincgc means -XX:+UseConcMarkSweepGC which is a low pause GC that implies a high overhead compared to parallel collectors. I would switch to parallel collectors.

  • -XX:NewSize=8m means that the young generation size is 8MB, this is really small and against the weak generational hypothesis. Remove this option and let the JVM adjust heap size depending on how you use the application.

  • -XX:PermSize=1024m is equal to MaxPermSize. Setting min=max is a nonsense. Remove the minimum size and let the JVM manage permanent generation size.

  • -XX:+UseConcMarkSweepGC, cf 1.

  • -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSConcurrentMTEnabled -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:ConcGCThreads=2 -XX:CMSIncrementalDutyCycle=5 -XX:+UseCMSCompactAtFullCollection -XX:+CMSClassUnloadingEnabled -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses are CMS related. Cf 1, I would switch to parallel collectors so you should get rid of those options.

  • -XX:+UseParNewGC -XX:ParallelGCThreads=2 means that you were giving 2 threads for a parallel collector in the young generation (8 MB). This won't really do anything.

  • -XX:GCTimeRatio=49 -XX:MaxGCPauseMillis=20 -XX:GCPauseIntervalMillis=1000 here you are saying "I want my GC to take les than 49% of my time, with a pause of maximum 20ms and at least 1 second between each pause". You are asking for very short GC that will happen very often. Probably not what you want.

You may notice that these are almost all your JVM options. This is correct :)

Try this configuration and let us know if it solved your problem :

-nosplash
-vmargs
-Xss500k
-Dosgi.requiredJavaVersion=1.6
-Xms128m
-Xmx1024m
-XX:MaxPermSize=1024m
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+AggressiveOpts
-Xloggc:gc.log
-XX:+PrintGCDetails

Sources :

1
  • thank you for your answer, very well explained, and yes it really help my eclipse be better ^^ May 1, 2013 at 0:10
1

Do you have an SSD? If not buying one will really improve your performance experience because development means a lot of IO.

1
  • actually I bought one too taking this issue in consideration too May 1, 2013 at 0:10
1

If you want to speed up your development process, i think you are looking at the wrong place. The performance of your system should be more than enough. Maybe you could raise the -Xmx a bit, depending on your application. Maybe an ssd would boost the performance too.

I for myself, could speed up my development with jrebel(http://zeroturnaround.com/software/jrebel/). This is a tool that allow you hot replacement of nearly any part of your application. So you do not have to redeploy the whole application every time. I know it costs money, but it paid of quickly. Maybe there are also some free alternatives i don't know yet.

1
  • thank you for the advance, I will checkout about jrebel for sure! May 1, 2013 at 0:09
0

win/linux/mac: you can put JDK into read-only RAM disk and run it from there

linux: you could use anything-sync-daemon to keep both Eclipse and Glassfish (and possibly maven local repository ".m2") in RAM and synchronize it into HDD/SSD periodically

I also recommend reading this:

Tip 1 : Always run the latest JDK and Eclipse.
Tip 2 : Tune Eclipse Preferences
Tip 3 : Keep your JDK on a RAM Disk
Tip 4 : Tweak your eclipse.ini
Tip 5: Get your anti-virus outta here
Tip 6: Keep SVN and GIT out of Eclipse
Tip 7: Use your keyboard

at http://www.nicolasbize.com/blog/7-tips-to-speed-up-eclipse/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.