OpenJ9 shared classes with Eclipse Equinox 4.9+

The blog post Eclipse OpenJ9 performance; a bake-off on Windows mentions the Class Data Sharing (CDS) adapter required to enable OpenJ9 shared classes support for the OSGi Equinox framework. Since Eclipse Equinox 4.9 2018-09, the CDS adapter is included with Equinox builds.

When running with an Eclipse OpenJ9 JVM, to enable shared classes support for the Eclipse IDE or other products based on Equinox,  follow one of these suggestions:

a) Start the IDE with the additional command line arguments -vmargs -Xshareclasses:name=eclipse

b) Add the following to the eclipse.ini file

-vmargs
-Xsharedclasses:name=eclipse

 

After using the Eclipse IDE for a while, check the amount of space used in the shared cache by running java -Xshareclasses:name=eclipse,printstats. If the free bytes is close to zero, the size of the cache can be increased. For example by running java -Xshareclasses:name=eclipse,adjustsoftmx=80m or any size up to the hard limit, which is 300m by default. The shared cache persists on disk until destroyed, the modified settings will be in effect for as long as the cache exists. Once an ideal size is determined, it can be hard coded by adding a -Xscmx option to the above examples.

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s