I recently switched from Eclipse 3.6 to STS 2.7.1 (based on Eclipse 3.7). Ditching my old .project and workspace settings files along with the move has made for a smoother experience; it seems these files get corrupted over time,1 and I’m too lazy to do the research to fix them. However, the upgrade resulted in performance issues. For instance, it hung for ~10 seconds every time I saved web.xml, and there were various random pauses. It’s not the hardware: I’m on a Core i7 Quad with 6GB RAM running Win7 x64. I realize you are getting more tooling with STS, but performance was much worse than I experienced with 3.6.
Well, it had slipped my mind that I had updated my 3.6 eclipse.ini settings with those I had found in an excellent Stack Overflow answer from VonC on optimal JVM settings for Eclipse. It hasn’t been updated for 3.7 (nor does it mention STS), but after some experimenting and research it appears to work well for it. Here are my settings, and below I add some commentary on what they do, which is missing from the original answer (although I still suggest you read that, as it covers other situations/issues that may affect you). Keep in mind I’m not a JVM tuning expert, YMMV, etc. Here are the contents of my sts.ini:
This is the number of method invocations/branches before compiling. This is normally set to 10,000, so we’re changing it dramatically, but the original suggestion was leading to errors so I raised it. You will notice on startup that it takes longer, and your CPU usage jumps. However, your performance after that is much better. Those 10s save times for web.xml? Gone after this. I’m willing to take a hit at the beginning for better productivity while coding.
Related to the above, I was getting the error “Unhandled event loop exception / out of space in CodeCache for adapters” due to setting the compile threshold to 5. This is another solution to that problem, and may be redundant.
This is stack size, and was previously set to 1MB, now up to 4MB per thread. Doing this will increase the overall memory used.
These enable parallel garbage collection. I saw my CPU utilization reach 100% after this, which is rare on a Core i7 Quad. It felt like I was finally using it to its potential.
Again, I’m not an expert. I’ve found it’s more sluggish at first, but response times quickly improve. For me, it’s a clear net gain. Not documented are the things I turned off in preferences because I wasn’t using them (Maven is disconnected, etc.). Visit Windows >> Preferences and filter on startup, see if there’s anything you can get rid of. Finally, I must give credit to my sources outside the original article:
- I’ve had issues with things like web deployment assemblies, not prompting for workspace on startup, etc. [↩]
Thank you! I was getting an error (could not create the java virtual machine) after upgrading to STS 2.7.1, and nothing I did would fix it. I used your settings above and it worked. I hope this helps other people that have the same problem. 🙂
thanks! major improvement in speed
It was useful
Thanks, STS is now much faster ands responsive on my laptop with Intel core i7 and 4GB ram, running Windows 8 Pro x64.
This is entirely anecdotal and it may be a red herring, but it seems I get better performance within eclipse if I specify the highest possible value for -Dosgi.requiredJavaVersion. Jumping from 1.5 to 1.6 made a noticeable difference, but 1.6 to 1.7 may have as well. I.e.:
To be clear, that would imply you’re running a java 7 VM, which the example given in this blog post is not.
I was struggling with my STS, I use to wait for literally 5+minutes .. but the settings you provided – its complete magical turnaround.
Wow!! My STS started within 2 minutes as opposed to 10+ minutes after using these settings!!
Very fine! Thank you very much!
Before applying this setting STS 3.6.3 use more than 50% of CPU in idle state.
Now it normal! My CPU is free! 🙂
Works well. Thanks