From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 28-MAY-1991 17:33:04.52 To: ARISIA::EVERHART CC: Subj: Re: MEMTRIM From: RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2 To: Everhart@Arisia@MRGATE Received: by crdgw1.ge.com (5.57/GE 1.97) id AA05307; Tue, 28 May 91 16:31:22 EDT Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Tue, 28 MAY 91 12:29:03 PDT Received: by ucbvax.Berkeley.EDU (5.63/1.42) id AA09721; Tue, 28 May 91 12:20:16 -0700 Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 29 May 91 01:13:25 GMT From: munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!mits.com.au!alistair@uunet.uu.net Subject: Re: MEMTRIM Message-Id: <1991May28.201326.3466@mits.com.au> References: <15MAY91171614@marie.mit.edu> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <15MAY91171614@marie.mit.edu>, chuck@marie.mit.edu (CHUCK PARSONS 617-253-4157) writes: > I just picked up MEMTRIM from VMSNET.SOURCES and really like it. >It really helps our batch jobs by freeing up a lot of memory. However Glad you like it! >We found that knocking the working set down to 200 is sometimes to heavy >a hit, processes go into RWMPB wait for as much as a minute or so, and >if this is DECWINDOWS thats anoying to the user. So I modified MEMTRIM.MAR >as follows: > >;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >; ACB with the codde following >;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Trim_KAST: >acb: .blkb acb$k_length ;Allocate space for a baseline ACB >old_ws: .blkl 1 ;saved working set size >Trim_Code: > $adjwsl_s wsetlm=old_ws ;get current wworking set size > blbc r0,escape ;if error get out > pushl r3 ;Save r3 > subl3 #200,old_ws,r3 ;compute the difference between > ;the current working set size and > ;the new size of 200 pages > blss escape ;if he is already under then get out >; ********** begin new code CCGP may 15 1991 > ashl #-1,r3,r3 ;divide by tw0 only do half at a time > incl r3 ;to make change gentler >; ************* end new code > mnegl r3,r3 ;negate the difference > $adjwsl_s pagcnt=r3 ;Adjust down to 200 pages >escape: movl r5,r0 ;set up for deallocation > popl r3 ;restore r3 > jmp g^exe$deanonpaged ;get out of here >MemTrimAst_sz = . - Trim_KAST > > .end > > Expecting that it would knock the workingset down half the distance >from current size to 200 pages (+1). It does work, reducing the size >gradually, but it seems to not exactly the formula: > > new_size=200+(old_size-200)/2 + 1 This isn't the formula you have above! The call to $adwsl specifies how much to CHANGE the working set by, not the new value. Your formula is :- new_size = old_size - (old_size-200)/2 + 1 > that I expect, often the reduction is a good bit less. > > Just wondered if anyone out there could explain it to me. If I've made >some stupid assembler mistake please be gentle ;-) > >thanks CHUCK@MITLNS.MIT.EDU This seems like a good idea, I may use it a bit myself. Thanks, Alistair Grant Internet: alistair@mits.com.au PSI Mail: psi%0505238730004::alistair Alternate: alistair%mits.com.au@ucsvc.ucs.unimelb.edu.au grant@decus.com.au Phone: +61 3 615 4641 Fax: +61 3 615 4408