Is This Problem Called Memory Leak? My Application include 5 Different Form. I Showing One of Them by Using this Code :
Form2 frm2 = new Form2();
frm2.ShowDlialog();
Form2 Includes : Buttons, TextBox, Lables, Listbox to Add Items Into the ListBox.
When frm2 Appears, It Get 1MB Memory (Based on Task Manager). After Closing Form2, The Memory Still High And it Does not Decrease. If I Call frm2.ShowDlialog() For Multiple Time, Application Memory Increased Every Time.
What I have tried:
I Searched in Google and tried :
Number 1 :
Form2 frm2 = new Form2();
frm2.ShowDlialog();
frm2.Dispose();
Number 2 : (in Form2_FormClosing)
GC.Collect();
Number 3 :
I saw articles that talking about this :
Quote:
The first place to look for leaks is in event-handling rather than missing Dispose() calls. Say your container (the parent form) loads a child form and adds a handler for an event of that child form (ChildForm.CloseMe).
If the child form is intended to be cleared from memory then this event handler must be removed before it is a candidate for garbage collection.
Note : I'm using ADO.NET in Form2_Load events. (Software Based on CRUD)
Can anyone help me?