MDI Windows Memory Allocation Grief :-/

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Mayers

    #1

    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.


Working...