<p>I'm running some JUnit tests on my applications. Every test has a for loop calling respective method 10000 times.
The tested methods produce a lot of log. 
These logs are also automatically collected by JUnit as test output.
This situation takes to OutOfMemoryError because the string buffer where JUnit keeps the output becomes too large.
I dont' need these logs during tests, so if there is a way to tell JUnit "don't keep program output" it would be enough.
Any ideas?</p>

Some options:
Change your logging so that it dumps to a file instead of standard output.
Increase the maximum heap size with
```
-Xmx <some number>M
```
, like
```
-Xmx 256M
```
.