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

archiveArtifacts uses large amount of heap space when no files are found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None
    • Ubuntu 18.04.6
      openjdk 11.0.15 2022-04-19
      Jenkins 2.332.3

      archiveArtifacts tries to display a helpful error message, if no artifacts are found:

      archiveArtifacts(artifacts: 'test*.txt') 

      leads to

      ‘test*.txt’ doesn’t match anything, but ‘a/test*.txt’ does. Perhaps that’s what you mean? 

       

      To find the suggestions, Jenkins prepends `**/` to the given pattern and runs it again. With large workspaces, this leads to an insane amount of files being checked. In our case, the pipeline step fails after several minutes with an Java.lang.OutOfMemoryError, taking down the whole node. A heap dump taken on error shows a DirectoryScanner object taking more than 2 GB of memory.

      We are aware that we could increase the VMs heap space even further, however just displaying an error message should not take several gigabytes of memory.

            Unassigned Unassigned
            jwetter Jan Wetter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: