How to change memory and other JVM settings for STS
STS runs on top of a JVM that is configured at startup with some default values that we think are suitable for many users. Nevertheless users may find other settings more useful for them, especially when using additional extensions for other languages like the Groovy or Scala, a larger heap can improve performance a lot, for example.
The JVM that STS is running on is configured in the sts.ini file. You can find this in the same place as the STS executable (Mac users might need to dive into the STS.app bundle and there into Contents/MacOS). Open sts.ini and take a look at the default settings (among other settings which you should not touch):
Code:
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xmn128m
-Xms256m
-Xmx768m
-Xss1m
-XX:PermSize=128m
-XX:MaxPermSize=384m
Here you can change the maximum heap setting (-Xmx2048m for example) and all the other JVM options that your runtime offers.
Note: Some operating systems, especially the 32bit ones, restrict the maximum memory setting for a single app to a specific amount, so STS might fail to start the JVM if your settings are not valid on your system. Backing up the sts.ini file before changing it is therefore recommended.
I would also like to invite everybody to share their optimal settings here, so others can try out!
Looking forward to reading about your experiences with different settings!
Best regards,
-Martin