Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1808

OutOfMemoryError running with TestNG

    XMLWordPrintableJSON

Details

    Description

      Hi team,

      We've been suffering OutOfMemory intermittently in our test labs recently. The call stack is below 

      [ERROR] Java heap space -> [Help 1]
      java.lang.OutOfMemoryError: Java heap space
          at java.util.Arrays.copyOf(Arrays.java:3332)
          at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
          at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
          at java.lang.StringBuilder.append(StringBuilder.java:136)
          at org.apache.maven.plugin.surefire.booterclient.ForkStarter$CloseableCloser.run(ForkStarter.java:200)
          at org.apache.maven.surefire.shade.common.org.apache.maven.shared.utils.cli.CommandLineUtils$1.call(CommandLineUtils.java:301)
          at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:615)
          at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283)
          at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1161)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1002)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:848)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

       

      Our test case count is +4k and still increasing, and pass rate is around 95% for each execution. The OOM error is not always reproducible. And we set memory dump parameters, but there is no dump file generated when it occurs. 

      The line of code throwing the exception is below. 

       

      More version information:

      maven-surefire-plugin: 3.0.0-M3

      testng: 6.4

      maven: 3.2.5

      Attachments

        1. image-2020-12-29-13-31-31-539.png
          561 kB
          Jingfei Hu
        2. image-2020-12-29-13-58-44-076.png
          783 kB
          Jingfei Hu
        3. image-2020-12-29-15-16-28-566.png
          732 kB
          Jingfei Hu
        4. image-2020-12-29-17-14-42-884.png
          1.87 MB
          Jingfei Hu
        5. image-2020-12-29-17-18-56-557.png
          18 kB
          Jingfei Hu
        6. image-2020-12-29-17-19-51-660.png
          37 kB
          Jingfei Hu

        Activity

          People

            Unassigned Unassigned
            jingfei Jingfei Hu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: