473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

MDI Child Form Dispose?

Hi,

I am developing an application which has established on MDI Form and there
are many MDI Child forms. My problem is starting when i close the mdi child
forms. They are not disposed from the virtual memory, so it wastes much
memory for the clients. I trigger GC.Collect and i also implemet IDisposable
method for all object that i have created. But when i use a memory profiler
that shows the status of the current object for my application, i see that
there are many native controls and some objects that are not disposed from
the memory.

I use C# and .net framework 2.0, so have you met problem as same as my
problem? If you have suggestion it will very helpful for me. Thanks..

May 21 '07 #1
3 9630
Adam,

Do you set any methods on your MDI forms as event handlers for other
objects outside of the MDI form? If so, that could be extending the
lifetime of your MDI form.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Adam Right" <aa*@aa.comwrote in message
news:91**********************************@microsof t.com...
Hi,

I am developing an application which has established on MDI Form and there
are many MDI Child forms. My problem is starting when i close the mdi
child forms. They are not disposed from the virtual memory, so it wastes
much memory for the clients. I trigger GC.Collect and i also implemet
IDisposable method for all object that i have created. But when i use a
memory profiler that shows the status of the current object for my
application, i see that there are many native controls and some objects
that are not disposed from the memory.

I use C# and .net framework 2.0, so have you met problem as same as my
problem? If you have suggestion it will very helpful for me. Thanks..

May 21 '07 #2
Hi,

I have one MDI form and all other forms are its children. So if mdi form is
closing that means my application is closing. But my problem is about the
child form in which the native controls and some objects are not disposing.
In the profiler, i have seen that whenever i open a child form, the active
objects get more and more. Although i close and dispose the child form, the
native controls and some object remain alive.

When i close a child form, i also set the event handlers of the child form
to null. But as i said before in the memory i see always native controls
much.

Did you try that when you add many controls on a child form, and close it,
what happens on the virtual memory? In my application it remains same.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:uM**************@TK2MSFTNGP02.phx.gbl...
Adam,

Do you set any methods on your MDI forms as event handlers for other
objects outside of the MDI form? If so, that could be extending the
lifetime of your MDI form.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Adam Right" <aa*@aa.comwrote in message
news:91**********************************@microsof t.com...
>Hi,

I am developing an application which has established on MDI Form and
there are many MDI Child forms. My problem is starting when i close the
mdi child forms. They are not disposed from the virtual memory, so it
wastes much memory for the clients. I trigger GC.Collect and i also
implemet IDisposable method for all object that i have created. But when
i use a memory profiler that shows the status of the current object for
my application, i see that there are many native controls and some
objects that are not disposed from the memory.

I use C# and .net framework 2.0, so have you met problem as same as my
problem? If you have suggestion it will very helpful for me. Thanks..

May 21 '07 #3
Hi,
I have the same problem and nothing seem to work, my memory gets bigger and bigger and the client more nervous. Please, if you have any conclusion or suggestions on this issue share it here.
I tried calling dispose on every tiny object I use, I removed all event handlers but no improvement what so ever.
Thanks
Anca
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form),...
1
by: Martin Douglas | last post by:
Hey guys, maybe someone can help me with some MDI issues I have. A co-worker asked me a very simple question, one that I blew off as trivial, and it has become a time-consuming issue. Simply...
2
by: CJack | last post by:
Hy. I have an MDI form Parent. on run-time it creates a child form Child1. when you press a keyboard button, the Control on Child1 recieves the KeyUp event, which raises the KeyUp event of Child1...
3
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: Bruin | last post by:
Hi All, I'm having a problem with MDI child forms when the reference to the MDI Parent is set in a Control library. (Sorry for the long post) I have an control library assembly which holds all...
2
by: Lenster | last post by:
Environment --------------- Visual Studio.NET 2003 Version 7.1.3088 ..NET Framework 1.1 Version 1.1.4322 SP1 XP Professional 5.1.2600 SP2 Build 2600 Problem Description...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.