Repository navigation
Closed
Labels
Description
Describe the bug
System.OutOfMemoryException while merging not so big files, trying to eat 10+ Gb in build pipeline
To Reproduce
dotnet tool install --global dotnet-reportgenerator-globaltool - newest at the moment of writing (5.5.5)
$ reportgenerator "-reports:${CI_PROJECT_DIR}/artifacts/tests/coverage_*.xml" "-targetdir:${CI_PROJECT_DIR}/artifacts/tests/merged" -reporttypes:"Cobertura;HtmlSummary"
2026-04-20T15:32:58: Arguments
2026-04-20T15:32:58: -reports:/builds/pp/pp3/artifacts/tests/coverage_*.xml
2026-04-20T15:32:58: -targetdir:/builds/pp/pp3/artifacts/tests/merged
2026-04-20T15:32:58: -reporttypes:Cobertura;HtmlSummary
2026-04-20T15:33:22: Error during reading report '/builds/pp/pp3/artifacts/tests/coverage_Pp3.Companies.Tests.xml' (Size: 50.7MB): Multiple errors
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
2026-04-20T15:33:32: Error during reading report '/builds/pp/pp3/artifacts/tests/coverage_Pp3.Mailer.Tests.xml' (Size: 52MB): Multiple errors
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
2026-04-20T15:33:40: Error during reading report '/builds/pp/pp3/artifacts/tests/coverage_Pp3.Tests.xml' (Size: 61MB): Multiple errors
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
Exception of type 'System.OutOfMemoryException' was thrown.
The files in charge: https://drive.google.com/drive/folders/1cz6Ff9E3aZTIrVffQxyeFCnyoZ5HwXnS?usp=drive_link
Activity
danielpalme commentedon Apr 20, 2026
Thanks for the sample files.
The problem is not the size of the coverage files.
The root cause is the following:
Over 12.000 classes are defined in a single file (
EisTypes.cs). This file is really long (145.229 lines).When ReportGenerator iterates over the classes, it generates arrays with coverage information for each file a class is defined in.
12.000 times 145.229 consumes a lot of memory.
To work around the issue you could:
-filefilters:-*EisTypes.csxumix commentedon Apr 21, 2026
@danielpalme Unfortunately I'll not be able to split the file, will try to exclude it. Thanks!
But anyway, the memory usage seems excessive even for 12k types file.
#783: Reduce memory usage for large coverage files
danielpalme commentedon Apr 26, 2026
I was able to reduce the memory usage significantly for large files.
You could try the new release 5.5.7 without the
filefilters.xumix commentedon Apr 26, 2026
Thank you!
chore(deps): update danielpalme/reportgenerator-github-action action …
Update GitHub Actions (#1498)
Give the report library the approved source text through its public I…
Resolve deterministic and other-agent source paths as ReportGenerator…
Resolve deterministic and other-agent source paths as ReportGenerator…