471,356 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

MDI Windows Memory Allocation Grief :-/

Hi,

Hope that someone can shed some light on this.

I've got an MDI application with (for the sake of this discussion) 2 child
forms. Both of these forms inherit from on a common 'Base' form which is
quite 'bulky', in that it contains a potentially large DataGrid and a bunch
of supporting DataSets, DataViews etc.

Also on my MDI Parent form, I have a 'Windows' menu option which has the
MdiList property set to True so that it displays a list of MDI Children.

For the purposes of testing, I have a button on my MDI Parent form to force
a GC.Collect.

OK.
If I run the application, open FormA and load a bunch of data onto the
datagrid, then open FormB load a bunch of data onto his datagrid, then I
select FormA (by clicking on the form) and close it, then close FormB to
return to the empty MDI Parent form. All seems to be well and the GC
retrieves all the available memory.

However, and this is the bit I don't understand, if I repeat the above test,
exactly the same, except that when closing FormA, instead of clicking on it
to select it, I use the 'Windows' menu then when I have closed both forms
and returned to the Parent form, the memory never seems to get released, no
matter how long I wait, or how many GC.Collects I force.

If anyone could give me a hint as to what the difference between these two
methods is I would be a happy bunny!

TIA

Chris.
Jul 21 '05 #1
0 1015

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.