Re: working set and console applications



Thank you for your detailed response Jeffery!



I created a windows application and then I created a child console process
that I started from the parent process using CreateProcess(). After
creating the child console, I attached the parent application to it using
AttachConsole().



If I minimize the windows application, I see no change in the working set as
long as I override the default SC_MINIMIZE sys command handler. However, if
I minimize the child console window it also causes the working set of the
parent application to be trimmed.



The only thing that gives me the behavior that I desire is if I create an
IPC connection between the parent and child process instead of using
AttachConsole(). Is it by design that minimizing a console window always
trims the working set of all processes attached to that console window?





""Jeffrey Tan[MSFT]"" <jetan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:t0lQhATEIHA.4664@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Matt,

I have consulted this issue with another kernel developer. Below is his
comment:
"This behavior is removed in Vista/Win2008. There's not a way to change it
in previous OS versions though you could work around it by splitting the
main process off of the console.

The process is not forced to disk at the point it's minimized though. The
pages are placed on the standby and, if a modified page, the modified
list.
The pages can be soft faulted back in as long as they remain in memory.
The pages on the modified list will be written to disk and then placed on
the standby list. Of course, pages on the standby list are subject to
re-use so if something on the system is are allocating other pages (and
not
freeing them at the same rate; for example reading in a large file in a
random fashion) then the pages on the standby list can be repurposed
forcing the contents to subsequently be read from disk. Thus more memory
may help their performance in the short term."

So, I think the best solution currently is splitting the main process code
into a separate process, such as a Windows Service. Then, it will not be
affected by the console window minimize. Also, you may try a large
physical
memory machine to see if the performance will improve.(This will help to
prevent the standby list from re-used by other purpose, which improves the
performance)

Hope it helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.





.



Relevant Pages

  • Re: focus console based form???
    ... ShowDialog is normally meant to take a window handle ... the parent or owner and in turn shows a modal dialog so that you can't interact ... Blog: http://weblogs.asp.net/justin_rogers "Lore Leuneog" wrote in message ... > I' invoing a windows form from within a console application. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Need help solving a threading issue
    ... (represented by a SendMessage to the window) ... create HWND's on a secondary thread. ... thread, but the issues really *are* different if you create child windows, dialogs, etc. ... I agree a child HWND whose parent was created in another thread is an issue, ...
    (microsoft.public.vc.mfc)
  • Re: Position a modeless dialog over a modal dialog?
    ... When F is instantiated by its parent dialog using DoModal, ... Because A is a modeless dialog, I would add handlers to override the default OK and Cancel ... Why would you write a GetDlgItem call for any control? ... window, you must give its coordinates in parent client coordinates. ...
    (microsoft.public.vc.mfc)
  • Re: MFC and c++ problems
    ... the interface is defined by the control. ... Note that the messages of CButton are defined by the CButton ... I would think the parent would define which messages the child could send ... window didn't define the message itself, and you didn't design the classes ...
    (microsoft.public.vc.mfc)
  • Re: CreateProcess( ... ) always on top of my app.
    ... Not within the parent window, just on top of the app. ... This approach uses the parent window solely to control the placement of the child process window which in this example is a GUI applet. ... LPARAM lParam); ...
    (microsoft.public.vc.mfc)