5

Run your Eclipse IDE with Shenandoah GC

 2 years ago
source link: https://filippobuletto.github.io/eclipse-shenandoah/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

At a glancePermalink

This post is a revisitation of my previous one on ZGC. Unlike ZGC, Shenandoah is also available for Windows and macOS!


OpenJDK Wiki states that Shenandoah does the bulk of GC work concurrently, including the concurrent compaction, which means its pause times are no longer directly proportional to the size of the heap. Garbage collecting a 200 GB heap or a 2 GB heap should have the similar low pause behavior.

AvailabilityPermalink

Shenandoah is in upstream OpenJDK since JDK 12, under JEP 189. Backports to JDK 8u and JDK 11u are available as well.

Enabling EclipsePermalink

My setup includes:

Please note that Shenandoah GC is available only on HotSpot JVM, OpenJ9 JVM come with different GCs.

Download and install OpenJDK and Eclipse IDE, you can simply unpack the archives in you home directory, take note of installation paths.

Eclipse startupPermalink

Locate the eclipse.ini configuration file in your Eclipse installation directory.

Add the -vm option following these instructions, you may end up with something like:

-vm
/path/to/jdk-12.0.1/bin/java

Change the line containing -XX:+UseG1GC with:

-XX:+UnlockExperimentalVMOptions
-XX:+UseShenandoahGC

You may also change the heap size parameters Xms and Xmx to higher values, personally I have quadrupled the values, more on this here.

The result should look like:

-vm
/opt/java/jdk-12.0.1/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.5.300.v20190213-1655.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
[email protected]/eclipse-workspace
-XX:+UnlockExperimentalVMOptions
-XX:+UseShenandoahGC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms1024m
-Xmx4096m
--add-modules=ALL-SYSTEM

EnjoyPermalink

Now you can run Eclipse IDE and enjoy it with your low-pause GC equipped JVM!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK