Jenkins Appears to Have a Fast Memory Leak

Article ID:360017854772
1 minute readKnowledge base

Issue

  • Jenkins has a memory leak (java process using significantly more memory than max heap setting should allow)

  • Heap dump shows large objects used by JGroups HA library

Cause

There have been two known memory leaks in CloudBees CI/CloudBees Jenkins Platform related to the JGroups HA functionality. The first issue occurred in versions between 2.73.1.2 and 2.121.2.1, inclusive. This issue mainly happened in cases where HA was not being used. Upgrading to 2.121.3.1 fixed this issue. The second issue may always have been present; it was fixed in 2.289.2.2. In this case, a connection to the HA listener port from an unknown source could cause JGroups to read in data of unlimited size and store it indefinitely in memory. Upgrading to 2.289.2.2 fixed this issue.

Resolution

These issues have been resolved through updates to the included JGroups HA library that CloudBees CI uses. You should update to the latest stable release of CloudBees CI or CloudBees Jenkins Platform to avoid being impacted by these issues.

Workaround

If you are not using HA, or you are experiencing a JGroups memory leak and you aren’t able to upgrade immediately, you can disable the HA functionality to prevent the memory leak from happening.