Issue
-
Jenkins restarts randomly due to memory issues
-
The metaspace on the controller instance has been slowly filling, though the java heap space usage stays relatively low.
Environment
-
CloudBees CI (CloudBees Core) < 2.346.1.4
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller < 2.346.1.4
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller < 2.346.1.4
-
Java 11
Explanation
A bug in Java 11 JDK-8231454 is causing a leak of com.sun.beans.introspect.ClassInfo
the metaspace whenever a the method java.beans.Introspector#getBeanInfo
is invoked. In Jenkins, this is mainly used by the groovy engine through Pipeline: Groovy and Script Security for example.
The problem has been tackled in two directions:
-
workarounds have been implemented in Jenkins Core, Pipeline Groovy plugin 2705.v0449852ee36f and *Script Security_ plugin 1175.v4b_d517d6db_f0
-
a fix has been implemented in Java 11.0.16