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

Unbounded memory usage when running MANY tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.18.1
    • Backlog
    • Maven Surefire Plugin
    • None
    • win7, jdk 8u25, mvn 3.2.5
    • Patch

    Description

      I'm writing concurrency tests, checking that this thing is reproducible, that other thing isn't, and so on. So i repeat tests MANY times like 100_000 (to reproduce the leak, the test project is here: https://github.com/vandekeiser/parallel-stream-fork-join-pool)

      I see in VisualVM that the culprit is WrappedReportEntry, which indirectly holds references to lots of byte[] and char[] (allocation traces and heap dump pics are included in attachment)

      I forked and patched maven-surefire-common, and that makes the leak go. I had to replace WrappedReportEntry.original by a singleton fake ReportEntry.
      Bebefore that i had replaced Utf8RecodingDeferredFileOutputStream.deferredFileOutputStream by a NullOutputStream and the leak was lesser but still here.

      My fork of maven-surefire-common is there: https://github.com/vandekeiser/maven-surefire/tree/master/maven-surefire-common.
      It IS a patch so i checked the patch checkbox in the issue reporter, but it is NOT intended to be distributed of course since it is very brutal and basic.

      Also in my test project i explicitly deactivated reporting, but that doesn't make the reporting leak go away at all:
      <disableXmlReport>true</disableXmlReport>
      <printSummary>false</printSummary>

      Attachments

        1. older.png
          283 kB
          Balázs Németh
        2. newer.png
          314 kB
          Balázs Németh
        3. surefire-leak3.png
          110 kB
          Laurent Claisse
        4. surefire-leak2.png
          113 kB
          Laurent Claisse
        5. surefire-leak.png
          114 kB
          Laurent Claisse
        6. surefire-allocation-traces.png
          137 kB
          Laurent Claisse

        Activity

          People

            tibordigana Tibor Digana
            chtimi59 Laurent Claisse
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: