Issue
I have a memory leak due to the SSE Gateway plugin which causes my Jenkins instance to hit an Out of Memory error
Environment
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller
-
CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
-
CloudBees Jenkins Enterprise - Managed controller
-
CloudBees Jenkins Enterprise - Operations center
-
Server Sent Events (SSE) Gateway Plugin version 1.21 or older
Cause
As described in JENKINS-51057 the SSE Gateway plugin holds on to a queue of tasks and if those do not finish in a timely manner they can end up stacking up on the instance. This can result in the plugin using up large amounts of memory in the JVM, eventually causing an OOM error on the instance.
Resolution
Upgrade the SSE Gateway plugin 1.22 and this queue will timeout tasks that are in the queue after a certain amount of time.
Originally fixed in the version 1.18 the plugin got several stabilisation fixes related to this issue up until 1.22 (ex: https://github.com/jenkinsci/sse-gateway-plugin/releases ). We do not recommend to use the versions 1.18 to 1.21.