Details
-
Type:
Improvement
-
Status: Open (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Component/s: core
-
Labels:
-
Similar Issues:
Description
When running on Java 7, Jenkins should ensure that all its ClassLoader instances are marked parallel-capable. This would improve class loading speed in some circumstances—mainly during startup or when first using new features, but also when searching for Groovy imports and the like.
At least UberClassLoader, DependencyClassLoader, AntClassLoader2, and PluginFirstClassLoader should be so marked. (PluginFirstClassLoader ought to be made to extend AntClassLoader2 since we control it; all superclasses must be marked.) To work on Java 7, can use this idiom:
try { Method m = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable"); m.setAccessible(true); boolean b = (Boolean) m.invoke(null); if (!b) { ...warn... } } catch (NoSuchMethodException x) { // fine, Java 6 } catch (Exception x) { ...warn... }
(Unfortunately this pattern must be repeated in such class, since registerAsParallelCapable is caller-sensitive.)
Attachments
Issue Links
- is related to
-
JENKINS-24309 UberClassLoader does not cache negative results
-
- Resolved
-
- relates to
-
JENKINS-64479 deadlock in logging and classloading
-
- In Review
-
- links to
Fixed in bug 464442 and available as of 9.3.0. Currently we bundle 9.2.x.