As a Java Developer, we spend almost half of our time developing world class Java Applications. Your application might be touching thousands of users and making their lives easy in this very complex world 🙂
Here in this tutorial we will go over steps on how to speed up Eclipse performance by simply changing eclipse.ini
file.
Ever wondered?
- How can you
speed up
Eclipse? - FAQ How do I increase the heap size available to Eclipse?
- Share your tweaked eclipse.ini with Profiles for Eclipse
- Performance tuning parameters for Eclipse IDE
- eclipse.ini vm arguments tuning
Why we need to modify default eclipse.ini file?
By default, Eclipse foundation ships very basic bare minimum eclipse.ini
configuration file. Immediately after I download or upgrade to latest Eclipse.app, I usually update ini file by going to:
- Right click on
Eclipse.app
icon - Click on Show Package Contents
- Go to folder
/Contents/Eclipse/
- You will find
eclipse.ini
file
Basically I modify below things in eclipse.ini file based on Java 11 JDK configuration.
Mac Version of Eclipse’s eclipse.ini file
-startup ../Eclipse/plugins/org.eclipse.equinox.launcher_1.6.0.v20200915-1508.jar --launcher.library ../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.2.0.v20200915-1442 -product org.eclipse.epp.package.jee.product -showsplash org.eclipse.epp.package.common --launcher.defaultAction openFile --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Xss128m -Xmn1024m -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Xms1024m -Xmx3024m --add-modules=ALL-SYSTEM -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
As you see here, I have added/modified below parameters:
- -XX:+UseStringDeduplication
- Enables the String Deduplication feature within G1
- -Xss128m
- is used to limit how much memory a stack consumes
- -Xmn1024m
- the size of the heap for the young generation
- -Xms1024m
- this is initial Java Heap size
- -Xmx3024m
- this is maximum Java Heap size
Please replace your eclipse.ini file with this one.
Make sure to double verify above file. Make appropriate changes to path if required.
If you face JVM Path error then please follow Eclipse will throw JVM path error tutorial.
NOTE:
There is no permgen setting since JDK8. If you are running Java7 and below I would suggest you to add PermGen setting too.
Windows Version of eclipse.ini file
-startup plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar --launcher.library C:\Users\shah\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.700.v20180518-1200 -product org.eclipse.epp.package.jee.product -showsplash org.eclipse.epp.package.common --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.8 -Dosgi.instance.area.default=@user.home/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+AggressiveOpts --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=1.8 -Dosgi.dataAreaRequiresExplicitInit=true -Xss128m -Xmn1024m -Xms1024m -Xmx3024m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
Please update line 4
above with your user path.
Hope this helps you speedup your Eclipse IDE and workbench. Let me know if you face any issue modifying eclipse.ini
file.