It would appear that the ReportViewer control has a memory leak.
Create a new windows project with two buttons labeled 'Go' and 'Collect' with the following event handlers:
private void btnGo_Click(object sender,EventArgs e)
{
using (LeakyForm form = new LeakyForm())
{
form.Show();
}
}
private void btnCollect_Click(object sender,EventArgs e)
{
GC.Collect();
MessageBox.Show(GC.GetTotalMemory(true).ToString("#,###,###,###"));
}
Add another form to the project named LeakyForm and put a ReportViewer control on it. Run the app and you should see it leak about 50K bytes each time you press the 'Go' button and then close that form.
The situation gets much worse if you actually load reports and data into the viewer.

ReportViewer Memory Leak
TinyDev
I have gotten OutOfMemeory exceptions while working in the designer fairly regularly now. I'm not sure what exactly is doing it, whether its the designer or the Report Viewer I'm using during testing, but its annoying for sure. All of this is rather strange seeing that my machine seems to have plenty of resources and I have 4GB of RAM installed.
cm6043
(which I also referenced in the report to microsoft).
Alex_Mann
Hello all,
We are experiencing the same problem, an we are in July 2007 now. The canonical form of the problem seems as follows:
UserPreferenceChanged Evebt Handler is still subscribed after the form is closed.
Hope to get an answer from the Microsoft team.
Greetings,
Sarper Gurel
RayHerring
Could someone tell me where Sarper Gurel found that the report viewer subscribe to UserPreferenceChanged Event . I really spend ours find it without any good results.
dcd112778
Kevinadian
wow... Nearly 80 views on this thread and not a single comment. Anyone else seeing this issue
I put up a program stub if someone wants to play around with this. It consisits of 2 forms, 2 buttons and a report viewer control and can be downloaded at http://www.strawhatfarm.com/LeakStub.zip