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 ?
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 :