c# - Does Microsoft ReportViewer require special handling to Dispose correctly? -
i've spent last day tracking down seems memory leak issue in code, , believe have pinned down culprit - report generation. in order see problem lies created empty solution, button on blank form, linked event:
private void button1_click(object sender, eventargs e) { (int = 0; < 10000; i++) { microsoft.reporting.winforms.reportviewer temp = new microsoft.reporting.winforms.reportviewer(); temp.dispose(); } }
opening form , clicking button, watch windows task manager , can see memory begin climbing, along user objects, in matter of minutes hits cap of 10,000 , causes win32exception: unable create handle.
debugging line line, can see on creation user objects goes 7, , on dispose goes down 5.
i have tried temp.localreport.releasesandboxappdomain()
based on other issues people having, i've tried same loop using
around report viewer, see if behaved differently - didn't.
my question is, there special handling around reportviewer missing?
(fyi, i'm working on .net framework 4 microsoft.reportviewer.winforms version 10)
Comments
Post a Comment