• Icon: Suggestion Suggestion
    • Resolution: Fixed
    • None
    • None
    • None
    • Server- Windows Server 2003 R2 Standard x64 Edition, Bamboo 2.1.3
      Agent- Windows Server 2003 R2 Standard x64 Edition, Bamboo agent 2.1.2
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      In a very large build, lots of files and directories and about 100 projects, I got the following error at the end of the build log:

      simple 19-Dec-2008 19:53:44 Build process for 'Main - Main All Sample Template Test' returned with return code = 0
      simple 19-Dec-2008 19:53:44 Parsing test results...
      error 19-Dec-2008 20:00:55 Failed to execute the build 'MAIN-MAST-56': Java heap space
      simple 19-Dec-2008 20:00:56 Finalising the build...
      simple 19-Dec-2008 20:00:56 Stopping timer.
      simple 19-Dec-2008 20:00:57 Build MAIN-MAST-56 completed.
      simple 19-Dec-2008 20:00:44 Running post build plugin on server 'Clover Delta Calculator'

      And the following in the Error Summary for the build:

      Failed to execute the build 'MAIN-MAST-56'
      java.lang.OutOfMemoryError: Java heap space
      at java.lang.String.toCharArray(String.java:2726)
      at org.apache.tools.ant.types.selectors.SelectorUtils.match(SelectorUtils.java:334)
      at org.apache.tools.ant.types.selectors.SelectorUtils.matchPath(SelectorUtils.java:223)
      at org.apache.tools.ant.DirectoryScanner.matchPath(DirectoryScanner.java:448)
      at org.apache.tools.ant.DirectoryScanner.isIncluded(DirectoryScanner.java:1159)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1081)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1074)
      at org.apache.tools.ant.DirectoryScanner.checkIncludePatterns(DirectoryScanner.java:836)
      at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:808)
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:358)
      at com.atlassian.bamboo.utils.FileVisitor.visitAlLFilesThatMatchAPattern(FileVisitor.java:81)
      at com.atlassian.bamboo.utils.FileVisitor.visitFilesThatMatch(FileVisitor.java:58)
      at com.atlassian.bamboo.builder.AbstractBuilder.collateTestResults(AbstractBuilder.java:362)
      at com.atlassian.bamboo.builder.AbstractBuilder.runBuild(AbstractBuilder.java:280)
      at com.atlassian.bamboo.builder.AbstractBuilder.executeBuild(AbstractBuilder.java:232)
      at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:67)
      at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:192)
      at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:89)
      at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:105)
      at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:32)
      at edu.emory.mathcs.backport.java.util.concurrent.helpers.ThreadHelpers$1.run(ThreadHelpers.java:34)
      at java.lang.Thread.run(Thread.java:619)

      Failed to execute the build 'MAIN-MAST-56': Java heap space

          Form Name

            [BAM-3384] OutOfMemoryError while parsing test results

            Yes, turns out Ant's DirectoryScanner just can't handle large sets of files and/or directories without eating a lot of memory, even if you're only <include>ing a small portion of the files; confirmed this with Bamboo and with our own build files doing a similar wide scan of about 218,000 files in 33,000 directories. Increasing the memory limits as above took care of the problem.

            Chris Hilton added a comment - Yes, turns out Ant's DirectoryScanner just can't handle large sets of files and/or directories without eating a lot of memory, even if you're only <include>ing a small portion of the files; confirmed this with Bamboo and with our own build files doing a similar wide scan of about 218,000 files in 33,000 directories. Increasing the memory limits as above took care of the problem.

            MarkC added a comment -

            Chris,

            The agent will sill need their memory setting tweaked (otherwise they'd use the default amount of memory, which may not be enough)

            If you prefix the command to run the agent with:

            java -server -Xms32m -Xmx512m ...
            

            The parsing of the test results happens on the agents (rather than the server) so it will need to be given some extra memory.

            Cheers,

            Mark C

            MarkC added a comment - Chris, The agent will sill need their memory setting tweaked (otherwise they'd use the default amount of memory, which may not be enough) If you prefix the command to run the agent with: java -server -Xms32m -Xmx512m ... The parsing of the test results happens on the agents (rather than the server) so it will need to be given some extra memory. Cheers, Mark C

              Unassigned Unassigned
              1245fe8ac473 Chris Hilton
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: