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

fileCreateOperation leads heap overload on big files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • file-operations-plugin
    • None
    • file-operations-plugin 1.10
      jenkins 2.235.5

      fileCreateOperation of maven build log (with -X) makes heap memory consumption growth up to N*(log size) because of env vars expansion step here: 

      https://github.com/jenkinsci/file-operations-plugin/blob/master/src/main/java/sp/sd/fileoperations/FileCreateOperation.java#L46

      result = ws.act(new TargetFileCallable(listener, envVars.expand(fileName), envVars.expand(fileContent), envVars)); 

      During this step on big fileContent (600MB) Heap memory grows, GC permanently tries to clean, web interface hangs, Jenkins Master goes down for dozen of minutes.

      We've faced this issue few times on different instances

      Workaround: find SynchronousNonBlockingStepExecution thread whith highest memory allocation rate with memory profiler (visualvm) and try to stop it by javamelody (${JENKINS_URL}/monitoring?part=threads), or completely restart service.

       

       

      I think it would be great to limit fileContent size or optionally disable envVars.expand to preven

            pskumar448 Suresh Kumar
            brainsam Alexander Moiseenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: