15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Paging behaviour of MFC app

Pete MacLiesh -- pmac@Synopsys.COM
Wednesday, February 05, 1997


Environment: NT 4.0 & 3.51, MSVC 4.1

I have a large MFC app which execs a background process for some
long operations, and am seeing bad paging behaviour -- memory hogging.

If the MFC app soaks up memory, then execs the other process and
then sits back doing (almost) nothing, it holds memory - the working set
doesn't change, even though there is now another process vying for
the physical RAM. So, the poor background process is thrashing
away for a few megs RAM while the foreground is hogging everything
and doing nothing.

Now, simply iconizing the forground app lets it swap, and it shrinks
to about 1MB ... restoring also leaves it small. 

So, what can I do to the foreground process to indicate it's swappability
to NT? I have tried lowering the process priority to IDLE but that
seemed to have no effect ... any ideas?

Thanks,

PMac

___________________________________________________________________
Peter MacLiesh                *      Email:  pmac@synopsys.com
Synopsys Inc.                 *      Phone:  (415)694-4423
700A E. Middlefield Rd.       *      Fax:    (415)694-1747
Mountain View, CA 94043       *
___________________________________________________________________
Crayons can take you to more places than starships




Barry Tannenbaum -- barry@dddv.com
Friday, February 07, 1997

[Mini-digest: 2 responses]

At 07:59 AM 2/5/97 -0800, you wrote:

> Environment: NT 4.0 & 3.51, MSVC 4.1
>
> If the MFC app soaks up memory, then execs the other process and
> then sits back doing (almost) nothing, it holds memory - the working set
> doesn't change, even though there is now another process vying for
> the physical RAM. So, the poor background process is thrashing
> away for a few megs RAM while the foreground is hogging everything
> and doing nothing.

Check out SetProcessWorkingSetSize.  Setting the Min and Max working set to
0xffffffff is documented as swapping the process out of memory.

        - Barry

--------------------------------------------------------------------------------

3DV Technology, Inc              Phone: (603) 595-2200 X228
410 Amherst St., Suite 150       Fax:   (603) 595-2228
Nashua, NH  03063                Net:   barry@dddv.com


-----From: hou@tfn.com (Bing Hou)


You may consider put the forground process to sleep(use the Sleep function) 
for certain amount of time interval. But make sure your background 
process's priority is no lower than the forground's. The Sleep function 
will yield time slice to other processes with same priority level.


Bing Hou
hou@tfn.com
------------------------------------------------------------------------
  Recall it as often as yo wish, a happy memory never wears out.
                




______________________________ Reply Separator _________________________________
Subject: Paging behaviour of MFC app
Author:  Pete MacLiesh  at Internet
Date:    2/5/97 7:59 AM


     
Environment: NT 4.0 & 3.51, MSVC 4.1
     
I have a large MFC app which execs a background process for some
long operations, and am seeing bad paging behaviour -- memory hogging.
     
If the MFC app soaks up memory, then execs the other process and
then sits back doing (almost) nothing, it holds memory - the working set 
doesn't change, even though there is now another process vying for
the physical RAM. So, the poor background process is thrashing 
away for a few megs RAM while the foreground is hogging everything 
and doing nothing.
     
Now, simply iconizing the forground app lets it swap, and it shrinks 
to about 1MB ... restoring also leaves it small. 
     
So, what can I do to the foreground process to indicate it's swappability 
to NT? I have tried lowering the process priority to IDLE but that
seemed to have no effect ... any ideas?
     
Thanks,
     
PMac
     
___________________________________________________________________ 
Peter MacLiesh                *      Email:  pmac@synopsys.com 
Synopsys Inc.                 *      Phone:  (415)694-4423
700A E. Middlefield Rd.       *      Fax:    (415)694-1747 
Mountain View, CA 94043       *
___________________________________________________________________ 
Crayons can take you to more places than starships
     




Become an MFC-L member | Вернуться в корень Архива |