Slow Classloading with many jars on the classpath [message #1854510] |
Tue, 23 August 2022 10:41 |
Hanno Wiegard Messages: 2 Registered: August 2022 |
Junior Member |
|
|
We have a plugin which contains 224 jars in the Bundle-ClassPath section. With all the jars the startup of the plugin is extremely slow and when combining them into a single fat jar the startup time goes down to 10- 15% of the original startup time. When investigating this further and gathering stack traces, a majority of time is spent in
java.lang.Thread.State: RUNNABLE
at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1593)
at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1308)
at java.util.zip.ZipFile$Source.get(ZipFile.java:1271)
at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:733)
at java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850)
at java.util.zip.ZipFile.<init>(ZipFile.java:248)
at java.util.zip.ZipFile.<init>(ZipFile.java:177)
at java.util.zip.ZipFile.<init>(ZipFile.java:191)
at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:342)
at org.eclipse.osgi.storage.bundlefile.ZipBundleFile.doOpen(ZipBundleFile.java:51)
at org.eclipse.osgi.storage.bundlefile.CloseableBundleFile.internalOpen(CloseableBundleFile.java:140)
at org.eclipse.osgi.storage.bundlefile.CloseableBundleFile.lockOpen(CloseableBundleFile.java:78)
at org.eclipse.osgi.storage.bundlefile.CloseableBundleFile.getEntry(CloseableBundleFile.java:274)
at org.eclipse.osgi.storage.bundlefile.BundleFile.getResourceURL(BundleFile.java:142)
at org.eclipse.osgi.internal.loader.classpath.ClasspathEntry.findResource(ClasspathEntry.java:213)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalResources(ClasspathManager.java:466)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalResources(ClasspathManager.java:452)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalResources(ModuleClassLoader.java:331)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalResources(BundleLoader.java:922)
at org.eclipse.osgi.internal.loader.BundleLoader.findResources(BundleLoader.java:781)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.getResources(ModuleClassLoader.java:240)
at org.apache.logging.log4j.util.LoaderUtil.findUrlResources(LoaderUtil.java:273)
at org.apache.logging.log4j.util.LoaderUtil.findResources(LoaderUtil.java:254)
at org.apache.logging.log4j.util.PropertyFilePropertySource.loadPropertiesFile(PropertyFilePropertySource.java:41)
at org.apache.logging.log4j.util.PropertyFilePropertySource.<init>(PropertyFilePropertySource.java:36)
at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:449)
at org.apache.logging.log4j.util.PropertiesUtil$Environment.<init>(PropertiesUtil.java:434)
at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:88)
at org.apache.logging.log4j.util.PropertiesUtil.<init>(PropertiesUtil.java:80)
at org.apache.logging.log4j.util.PropertiesUtil.<clinit>(PropertiesUtil.java:56)
at org.apache.logging.log4j.util.Constants.<clinit>(Constants.java:30)
at org.apache.logging.log4j.spi.AbstractLogger.createClassForProperty(AbstractLogger.java:207)
at org.apache.logging.log4j.spi.AbstractLogger.<clinit>(AbstractLogger.java:95)
at org.apache.logging.log4j.core.AbstractLifeCycle.<clinit>(AbstractLifeCycle.java:38)
The part with the ModuleClassloader and opening ZipFiles stays all the time.
The Manifest is fairly simple:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BundleTest
Bundle-SymbolicName: com.BundleTest; singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: ...,
Bundle-Activator: com.BundleTest.Plugin
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: com.ibm.icu,
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.ui.intro,
org.eclipse.ui.console,
org.eclipse.jface.text,
org.eclipse.debug.ui,
org.eclipse.ui.forms,
org.eclipse.ui.views,
org.eclipse.search,
org.eclipse.gef,
org.eclipse.birt.chart.device.extension;resolution:=optional,
org.eclipse.birt.chart.engine;resolution:=optional,
org.eclipse.birt.chart.engine.extension;resolution:=optional,
org.eclipse.birt.chart.ui;resolution:=optional,
org.eclipse.birt.chart.ui.extension;resolution:=optional,
org.eclipse.birt.core;resolution:=optional,
org.apache.batik;resolution:=optional,
org.eclipse.emf.ecore,
org.eclipse.debug.core,
org.eclipse.ui.workbench.texteditor
Eclipse-LazyStart: true
where I have omitted the classpath.
Is there any alternative to combining all the jars into a fat jar?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03594 seconds