J
john
I have a button on a form, and when you click the button, it performs
the following:
using (FormMS f = new FormMS())
{
f.ShowDialog();
}
The new form that is shown (FormMS) has a DataGrid that gets bound to
a large DataTable. The DataTable is static so it only gets created
once. So I open FormMS as a dialog and then close it. I continue to
open and close it several times and each time, the memory used by my
application goes up a lot. It doesn't seem to deallocate the memory
needed by the DataGrid. I try calling GC.Collect() after the FormMS
closes and it doesn't do the trick. I tried letting the application
sit overnight to see if it would deallocate the memory and that
doesn't work. I try calling the DataGrid.Dispose method inside my
FormMS.Dispose method and that doesn't work. I have to restart the
application to get it to deallocate the memory. I keep opening it
again and again to see if I must use up all my physical memory before
it deallocates, and that doesn't work either.
Any ideas?
Thanks in advance.
the following:
using (FormMS f = new FormMS())
{
f.ShowDialog();
}
The new form that is shown (FormMS) has a DataGrid that gets bound to
a large DataTable. The DataTable is static so it only gets created
once. So I open FormMS as a dialog and then close it. I continue to
open and close it several times and each time, the memory used by my
application goes up a lot. It doesn't seem to deallocate the memory
needed by the DataGrid. I try calling GC.Collect() after the FormMS
closes and it doesn't do the trick. I tried letting the application
sit overnight to see if it would deallocate the memory and that
doesn't work. I try calling the DataGrid.Dispose method inside my
FormMS.Dispose method and that doesn't work. I have to restart the
application to get it to deallocate the memory. I keep opening it
again and again to see if I must use up all my physical memory before
it deallocates, and that doesn't work either.
Any ideas?
Thanks in advance.