Re: Creating Modeless Dialogs continually causing application to grow
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Mon, 07 May 2007 11:03:26 -0400
Art wrote:
... Our users have made tight loops in the language that run a ton of different subroutines. Over time the main application grows in memory due to the frequency of running all these modeless dialogs. Adding the timer to give the main application a moment of rest seems to remove the modelss dialog memory growth. Complicated and hard to explain in a paragraph.
I'd welcome any comments should someone have more detailed knowledge of the windows event driven system and provide more insight into the problem.
A number of MFC calls create temporary objects (for example, GetDlgItem) that will occupy memory until MFC gets a chance to clean them up. It does such cleanup in idle time (CWinApp::OnIdle). So a possible explanation for what you are seeing is that OnIdle is seldom or never getting a chance to run. MFC's definition of "idle time" is checking the message queue and finding no messages to dispatch. So if you are keeping the message queue continually busy, or the processor continually busy, the temporary objects will tend to build up, awaiting idle time. By introducing your timer you have probably created some idle time bewteen timer messages.
--
Scott McPhillips [MVP VC++]
.
- Follow-Ups:
- Re: Creating Modeless Dialogs continually causing application to grow
- From: Joseph M . Newcomer
- Re: Creating Modeless Dialogs continually causing application to grow
- References:
- Prev by Date: Re: "Detected memory leaks!" - how to proceed?
- Next by Date: Re: OnKillfocus event eats OnClick event
- Previous by thread: Re: Creating Modeless Dialogs continually causing application to grow
- Next by thread: Re: Creating Modeless Dialogs continually causing application to grow
- Index(es):
Relevant Pages
|
Loading