Well, after developing a plugin based architecture, with lots of menuitems, i
found that after adding a menuitem, and later removing, results in increased
memory.
I know all that thing with Dispose, finalizers, garbage collector, and so
on, they do not help.
'try this, to see a how fast memory grows.
dim i as int32
Dim m As New MenuItem("ok")
for i = 1 to 10000
Me.Menu.MenuItems.Add(m)
Windows.Forms.Application.DoEvents()
Me.Menu.MenuItems.Remove(m)
Me.Text = GC.GetTotalMemory(True).ToString
next
'however other controls does not leave their stuff
Dim m As New Label
dim i as int32
for i = 1 to 10000
Me.Controls.Add(l)
Windows.Forms.Application.DoEvents()
Me.Controls.Remove(l)
Me.Text = GC.GetTotalMemory(True).ToString
next
Christopher Kimbell - 16 Sep 2004 16:32 GMT
Download the latest service pack for the .NET framework.
SP3 article: http://support.microsoft.com/?kbid=867461
The following is one of the fixes:
FIX : Menu Items Leak When Added to a Menu Bar on a Windows Form:
http://support.microsoft.com/default.aspx?kbid=817723
Chris
> Well, after developing a plugin based architecture, with lots of
> menuitems, i
[quoted text clipped - 24 lines]
> Me.Text = GC.GetTotalMemory(True).ToString
> next
Giedrius - 17 Sep 2004 08:53 GMT
yes, but I use .Net Framework 1.1
> Download the latest service pack for the .NET framework.
>
[quoted text clipped - 35 lines]
> > Me.Text = GC.GetTotalMemory(True).ToString
> > next