M
Manoj Misran
After loosing all my hairs, I have finally come to a conclusion that
..NET is not made for 24/7 kind of business application because of
nasty memory leak and GC problems.
I developed a business application that is used for loading trucks in
a food processing plant. If this application stops, the entire loading
process comes to dead halt. I am using MDI with Menus and various Menu
Items and enabling/disabling Menu Items based upon user security. The
only Menu is on the Parent Form. There are no menus on any of the
child form. Now every time one user finish loading his truck and
logout the application holds some memory. It does not release complete
memory. The one and the only thing that I am doing in the logout
process is, Disabling all the Menu Items and show the login screen.
foreach(MenuItem M in mainMenu)
{
foreach(MenuItem N in mainMenu)
{
N.enabled = false;
}
M.enabled = false
}
Form loginForm = new LoginForm();
loginForm.ShowDialog();
loginForm.Dispose();
loginForm=null;
And in the login process, I am just enabling required MenuItems
depending upon user's security settings.
Now the Problem:
The application works perfactly fine for about 3-4 hours. But
gradually it runs out of memory and stops. User has to restart from
scratch. If he is in the middle of a transaction, he has to void the
entire transaction and regenerate the loading ticket.
Now the research part and why I lost all my hairs:
I baught a full copy of Memory Profiler just for this purpose. Did a
thorough and microscopic scan of all the objects generations and
disposals. Finally stuck at Menu Items. Just by enabling and disabling
MenuItems, the application holds Memory. It shows some
Hashtable.Bucket[] which has a reference to Menu Items. Nobody from
Microsoft talks about this thing.
I am so frustrated with the approach that Microsoft has taken with
this issue that I am partly deciding to moving away from .NET. I like
the overall ease of development in .NET but that doesn't help if I can
not make mission criticle applications like this.
Microsoft, pleeeeeeeeease understand that Menu and MenuItems are
integral requirement of every business application. I can possibly
find a workaround by totally removing all the menus and rewrite the
whole thing with my own menu system but that's not what I want. Had it
been a problem related to any other rarly used data structure, you can
hold on to it until the next release of framework but you can not do
the same for Menuitems.
I don't know what to do now. My management and the truck drivers are
loosing patience. Can someone help ...........
Microsoft, its a do or die situation for me. I have to take a decision
to be with .NET or forget it. Please do something...
Manoj Misran
(e-mail address removed)
..NET is not made for 24/7 kind of business application because of
nasty memory leak and GC problems.
I developed a business application that is used for loading trucks in
a food processing plant. If this application stops, the entire loading
process comes to dead halt. I am using MDI with Menus and various Menu
Items and enabling/disabling Menu Items based upon user security. The
only Menu is on the Parent Form. There are no menus on any of the
child form. Now every time one user finish loading his truck and
logout the application holds some memory. It does not release complete
memory. The one and the only thing that I am doing in the logout
process is, Disabling all the Menu Items and show the login screen.
foreach(MenuItem M in mainMenu)
{
foreach(MenuItem N in mainMenu)
{
N.enabled = false;
}
M.enabled = false
}
Form loginForm = new LoginForm();
loginForm.ShowDialog();
loginForm.Dispose();
loginForm=null;
And in the login process, I am just enabling required MenuItems
depending upon user's security settings.
Now the Problem:
The application works perfactly fine for about 3-4 hours. But
gradually it runs out of memory and stops. User has to restart from
scratch. If he is in the middle of a transaction, he has to void the
entire transaction and regenerate the loading ticket.
Now the research part and why I lost all my hairs:
I baught a full copy of Memory Profiler just for this purpose. Did a
thorough and microscopic scan of all the objects generations and
disposals. Finally stuck at Menu Items. Just by enabling and disabling
MenuItems, the application holds Memory. It shows some
Hashtable.Bucket[] which has a reference to Menu Items. Nobody from
Microsoft talks about this thing.
I am so frustrated with the approach that Microsoft has taken with
this issue that I am partly deciding to moving away from .NET. I like
the overall ease of development in .NET but that doesn't help if I can
not make mission criticle applications like this.
Microsoft, pleeeeeeeeease understand that Menu and MenuItems are
integral requirement of every business application. I can possibly
find a workaround by totally removing all the menus and rewrite the
whole thing with my own menu system but that's not what I want. Had it
been a problem related to any other rarly used data structure, you can
hold on to it until the next release of framework but you can not do
the same for Menuitems.
I don't know what to do now. My management and the truck drivers are
loosing patience. Can someone help ...........
Microsoft, its a do or die situation for me. I have to take a decision
to be with .NET or forget it. Please do something...
Manoj Misran
(e-mail address removed)