Path: utzoo!attcan!uunet!aplcen!samsung!cs.utexas.edu!ut-emx!mic From: mic@ut-emx.UUCP (Mic Kaczmarczik) Newsgroups: comp.sys.next Subject: Re: How do I shrink the swapfile (easily...) Summary: limit its growth using the hiwat setting in /etc/swaptab Message-ID: <25371@ut-emx.UUCP> Date: 1 Mar 90 20:44:25 GMT References: <2558@cs-spool.calgary.UUCP> Reply-To: mic@emx.UUCP (Mic Kaczmarczik) Organization: UT Austin Computation Center, Unix/VMS/Cyber Services Lines: 49 In article <2558@cs-spool.calgary.UUCP> schock@cpsc.ucalgary.ca (Craig Schock) writes: > > Last week, our swapfile decided to grow to 41 megs (from 21 megs). >The reason it did this hasn't yet been determined, but this occurrance >made me come up with some way of shrinking the file. I rebooted the >system (single user) and I killed off some of the unnecessary processes. >I then executed: > > mkfile 20M /private/vm/swapfile > >and this seemed to do the trick. I think this is done automatically on bootup, but I haven't checked lately... > What I want to know is ... Is there an EASIER way to bring >the swapfile back down to size? Since we are on a 330 Meg HD with only >58 Megs free a jump in the size of the swapfile from 21 megs to 41 megs >can cause some problems. Most VM systems I've worked with don't have a >"growing" swapfile so this little incident came as a little of a shock. I don't think there is an easy way to reduce the swapfile size. In my experience, once the swapfile has filled up the disk, about the only thing to do is reboot the system. However, I have been able to *limit* the growth of the swapfile by setting the hiwat parameter in /etc/swaptab; the one we're using on our consulting cube is: # # /etc/swaptab # /private/vm/swapfile lowat=20971520,hiwat=62914560 # 20 Meg low water mark This limits the size of the swapfile to around 60 meg, which will hopefully be enough for this particular cube (its swapfile seems to grow to about 37M after a day or so of operation, so there's plenty of room left). The swaptab man page has more details on the other settings that are available. --mic-- -- Mic Kaczmarczik mic@emx.utexas.edu (Internet) Unix/VMS/Cyber Services mic@utaivc (BITNET) UT Austin Computation Center ...!cs.utexas.edu!ut-emx!mic (UUCP) COM 1/UT Austin/Austin TX 78712 ``Good tea. Nice house.'' -- Worf Please direct consulting questions to gripe@{emx,ix2,ccwf,iv1} as appropriate.