ReportViewer memory leak on parsing RDLC ?

it seems that each time ReportViewer parses an RDLC file,
it leaks the memory that is created from parsing the XML.

A workaround, is if you need present lots of RDLC Reports (for example if writing out thousands of RDLC reports to PDF), then use a cache of ReportViewers.

That way, each time you need to process a report that uses the same RDLC, then just use the same ReportViewer (without setting ReportViewer.LocalReport.ReportPath).

Found this leak using the new CLR Profiler tool (version 4):
http://www.microsoft.com/download/en/confirmation.aspx?id=16273

Comments