javaeclipse-pluginosgieclipse-rcpequinox

Class files extracted in Equinox OSGi bundle cache?


I have an RCP application built of multiple custom plug-ins.

For several of the lower-level (but not lowest-level) plug-ins, all the class files are extracted from the plug-in jar into the OSGi bundle cache under the org.eclipse.osgi folder in the osgi.configuration.area.

The first launch using that configuration area is slow. Subsequent launches are fast. I don't know whether to blame this caching for the former, or credit it for the latter.

QUESTIONS

DETAILS

This is not happening for most of the plug-ins. Size doesn't appear to matter. It's not the lowest-level plug-ins. It's not the set of plug-ins that contain Bundle-NativeCode.


Solution

  • If a plug-in uses the FileLocator.toFileURL API this may unpack the code. The Javadoc says:

    The contents of the URL may be extracted into a cache on the file-system in order to get a file URL.

    You can sometimes avoid calling toFileURL by just using the URL.openStream method to read the resource without unpacking. APIs such as the JFace ImageDescriptor.createFromURL also don't require the file URL.