[
https://issues.apache.org/jira/browse/SUREFIRE-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17522507#comment-17522507
]
Mickael Istria commented on SUREFIRE-2072:
------------------------------------------
Unfortunately, I don't think there is a one-size-fits-all for this cache. I
would suggest to make it configurable in the `StartupReportConfiguration` to
let consumers (eg Tycho) optimize it according to their cases. For end-users of
maven-surefire-plugin, maybe it could as well be a mojo parameter.
I don't think 64kB is a bad value and I even trust it's a good one as you
demonstrated, so I do not advocate in favor of changing it by default. I'm more
looking for a solution to control this cache. However, if some other solution
(like discarding the stdout/stderr buffers whenever they're not necessary
anymore) is implemented, that's fine as well.
> The object of {{TestSetRunListener}} is not in fork. It is in Maven process.
As a reminder, the case here is tycho-surefire-plugin, that does run JUnit test
inside an Eclipse Platform/OSGi environment. In that story, the
TestSetRunListener is actually part of the test process, because it's what
seems to work best so far. Mayve it could be done differently/better, but it's
hard to change code that has been functioning without issues for a decade...
The tests do run sequentially, so the memory is freed between executions, the
tests used in the example used by
[https://github.com/eclipse/tycho/issues/879] don't seem to leave "leaks" after
execution. The memory consumed by the fork after a GC remains constants
(~130MB) after each test; while the TestSetRunListener does grow greedily.
> Surefire retains too much heap in some case, leading to OutOfMemory
> -------------------------------------------------------------------
>
> Key: SUREFIRE-2072
> URL: https://issues.apache.org/jira/browse/SUREFIRE-2072
> Project: Maven Surefire
> Issue Type: Bug
> Reporter: Mickael Istria
> Priority: Major
>
> Most likely since SuREFIRE-1845, every test execution can retain 64kB of RAM
> (as cache). Which caching is welcome, this cannot scale with some big test
> suites of several thousands of tests and cause OutOfMemoryError.
> This is the case when running Eclipse JDT dom test suite, since
> tycho-surefire-plugin started to adopt surefire 3.0.0.M6, as described in
> https://github.com/eclipse/tycho/issues/879#issuecomment-1096454637
--
This message was sent by Atlassian Jira
(v8.20.1#820001)