M
Manoj Misran
I have an MDI application with only one top level menu. All the menu
options called child forms and are no merge menus on these child forms.
They are simple forms with various controls and other things.
Now if I create various objects in this form class, do I really need to
dispose them and set them to null before closing the form? When I close
the form and set the form to null, I assume that all the variables or
objects or events created within that form should become unreachable
anyway and should be available for GC to collect. But then when I check
using scitech memory profiler and take a snapshot before calling the
form and compare it with a snapshot after closing and setting the form
to null, I see hundreds of strings and other objects generated and never
released. If I do the same thing second time, I see the same thing again
but lot less new objects and so on......
Can someone explain me what is wrong here and what is the best practice.
My application is 24/7 kind of business app and it runs out of memory
after every 3-4 hours of continuous use.
Thanks in advance
Manj Misran
options called child forms and are no merge menus on these child forms.
They are simple forms with various controls and other things.
Now if I create various objects in this form class, do I really need to
dispose them and set them to null before closing the form? When I close
the form and set the form to null, I assume that all the variables or
objects or events created within that form should become unreachable
anyway and should be available for GC to collect. But then when I check
using scitech memory profiler and take a snapshot before calling the
form and compare it with a snapshot after closing and setting the form
to null, I see hundreds of strings and other objects generated and never
released. If I do the same thing second time, I see the same thing again
but lot less new objects and so on......
Can someone explain me what is wrong here and what is the best practice.
My application is 24/7 kind of business app and it runs out of memory
after every 3-4 hours of continuous use.
Thanks in advance
Manj Misran