Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70388

Jenkins OOM when agent nodes alway keep running

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-api-plugin
    • None

      We are using Jenkins master-slave framework in our project to run 80 tasks for every 15 minutes. Jenkins is running in Kubenetes cluster and using Kubernetes plugin to run dynamic agent.

      We hope agent nodes alway keep running to process those tasks. So we set idleMinutes to 15 minutes. But it seems make Jenkins OOM. Below is the memory info of Jenkins after running 4 days. The young generation is growing very fast. If there is no task,  it grows about 1MB-2MB every second. But if running 80 tasks at the same time, it will grow about 6GB in one minute, and trigger 2 ygc. Full GC happens about every 40-50 minutes. But it only can release very little memory for every fgc. It’s clear that Jenkins is leaking memory.

      We dump memory snapshot of Jenkins. Below is memory leak suspects. Object DelayBufferedOutputStream takes more then 700MB space, and Object CpsFlowExecution takes 100MB space. Both these two objects are referenced from instance java.util.HashMap$Node[]. We suspect one node represents one slave node. If the slave node is not destroyed, related objects cannot be released.

      We also try to set idleMinutes  to 5 minutes, then agent nodes will be destroyed after completing tasks. Jenkins memory is normal. 

      Will Jenkins agent nodes always keep running cause memory leaks? Anyone can help on this? Thanks in advance.

            Unassigned Unassigned
            fushsh shanshan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: