Software written in winforms for transport, allows you to print the accompanying documents. On the datagridview , the right-click menu is made, depending on the selected flight, a report is generated in a new window in the reportViewer, which is actually the printed form of the document. I began to notice that every time the report was invoked, the software process consumes 2–3mb more RAM. I am new to c # I don’t know what to do, please help. Now did this:
Calling a document
private void callWaybill() { Waybill f6 = new Waybill(); f6.ShowDialog(this); } In the basic form did this
public void Dispose() { GC.WaitForPendingFinalizers(); GC.Collect(1, GCCollectionMode.Forced); } When closing a form with a document, I do this:
private void Waybill_FormClosing(object sender, FormClosingEventArgs e) { main m = this.Owner as main; m.Dispose(); }