Click here to Skip to main content
15,918,303 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have been struggling with memory consumption by ReportViewer RDLC recently. I have an WinForm application in which I have a reporting module using RDLC to display info to uers. I am getting feedback from users that memory consumption is high whenever they are using the reporting module. So, after some troubleshooting and research, I have come to a conclusion that each time the RDLC is loaded, ReportViewer will create a new appdomain to cater for the new RDLC. Therefore if I have fire the info generation event 10 times, I will have 10 appdomain for the RDLC.
I have found a way(ExecuteReportInCurrentAppDomain()) in which I will forcibly ask the application to use the current and only single appdomain which I can manage the memory consumption from getting shoot up.
I have tried to search online for any article on why in the first place does Microsoft design their ReportViewer dll to create separate appdomains for different RDLC. Is it starts from the beginning or is it only starts from .NET 4.0 onward? Anyone with idea?

What I have tried:

1. Search online for article/information

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900