[comp.sys.sgi] Can I force a swap?

atchity@tc3.chem.iastate.edu ("Gregory J. Atchity") (04/24/91)

   Is there any way to force a job on 4D machine (running 3.3.1) to be swapped
out of memory?

   It seems that my STOPped jobs still retain their memory, at the expense of
other programs that need it.  I'd like to run some memory hogs on PI's during
the day if the console is not in use, and then STOP them when someone logs on
the console.  But kill -STOP doesn't do what I want.

   I've noticed the same thing on DecStation 5000's.  Is this inherent in unix?

Greg Atchity                              Iowa State University
atchity@tc2.chem.IaState.edU              Ames Laboratory - USDOE
atchity%qchem1@alISUvax.bitnet            310 Wilhelm Hall
(515) 294-2582                            Ames, IA 50011

bh@sgi.com (Bent Hagemark) (04/25/91)

In article <9104231733.AA08996@tc3.chem.iastate.edu> atchity@tc3.chem.iastate.edu ("Gregory J. Atchity") writes:
>
>   Is there any way to force a job on 4D machine (running 3.3.1) to be swapped
>out of memory?
>
>   It seems that my STOPped jobs still retain their memory, at the expense of
>other programs that need it.  I'd like to run some memory hogs on PI's during
>the day if the console is not in use, and then STOP them when someone logs on
>the console.  But kill -STOP doesn't do what I want.
>
>   I've noticed the same thing on DecStation 5000's.  Is this inherent in unix?
>
>Greg Atchity                              Iowa State University
>atchity@tc2.chem.IaState.edU              Ames Laboratory - USDOE
>atchity%qchem1@alISUvax.bitnet            310 Wilhelm Hall
>(515) 294-2582                            Ames, IA 50011

All swapping (paging out) is done on demand.  There's no way to directly swap
a process out or to cause this just by sending a process a STOP signal (I
don't think the interactive csh user hitting a ^Z would appreciate this! :-).

I can certainly see how this would be handy in your case.  May I
suggest setting a low RSS limit on the memory hogs?  If there's no
contention for free memory the hogging process will actually be
fully resident, but when memory gets tight the pageout daemon will
enforce the RSS limits on these processes first.

Bent

russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) (04/29/91)

bh@sgi.com (Bent Hagemark) writes:

>In article <9104231733.AA08996@tc3.chem.iastate.edu> atchity@tc3.chem.iastate.edu ("Gregory J. Atchity") writes:
>>
>>   Is there any way to force a job on 4D machine (running 3.3.1) to be swapped
>>out of memory?
>>
>>   It seems that my STOPped jobs still retain their memory, at the expense of
>>other programs that need it.  I'd like to run some memory hogs on PI's during
>>the day if the console is not in use, and then STOP them when someone logs on
>>the console.  But kill -STOP doesn't do what I want.
>>
[ signature deleted ]

[ ..... ]

>I can certainly see how this would be handy in your case.  May I
>suggest setting a low RSS limit on the memory hogs?  If there's no
>contention for free memory the hogging process will actually be
>fully resident, but when memory gets tight the pageout daemon will
>enforce the RSS limits on these processes first.

We use a batch system on a 4D/240 which STOPs jobs when the queue closes.
'ps' show these jobs holding significant amount of memory hours later even
when the system is doing a significant amout of paging. i.e. the pageout
deamon does not appear to touch these jobs. 

Should we alter the limits on these processes after they have been stopped 
to get the deamon to reclaim the memory? (And set them back before they are
restarted of course.)

Russell.
-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton@aukuni.ac.nz>

mg@godzilla.cgl.rmit.oz.au (Mike Gigante) (05/01/91)

On our machine, STOP'd jobs *do* give up their memory if there is
enough demand. Try STOPing the jobs then runa program that does a couple
of big mallocs (use -lmalloc) s.t. the total malloced space > physical memory.

This *always* works for me, the RSS of processes that are ~30,000 pages
drop from ~14,000 pages (16k pages = 64Mb = physical memory) to ~ 50 pages.

This is a 340 running 3.3.2

Mike Gigante
RMIT