Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!munnari.oz.au!uhccux!cfht.hawaii.edu!jwright From: jwright@cfht.hawaii.edu (Jim Wright) Newsgroups: comp.sys.next Subject: Re: Lost pages in swapfile ? Keywords: NeXT, swapfile Message-ID: Date: 18 Apr 91 07:50:04 GMT Article-I.D.: cfht.jwright.671961004 References: <1991Apr15.153504.39750@slate.mines.colorado.edu> <332@nic.cerf.net> <1991Apr17.013649.532@arizona.edu> <1991Apr17.174031.28031@sequent.com> Sender: news@uhccux.uhcc.Hawaii.Edu Distribution: world,local Lines: 58 When I upgraded to 24MB of RAM, I truncated the swap file. E.g., immediately after rebooting (hence no application was using the swap file) cat /dev/null > /private/vm/swapfile shutdown -r now It's been about 2 weeks, and it has yet to grow to 1MB. On startup I run Workspace, Preferences, Webster, Digital Librarian, and three Terminal windows. I also run a variety of other applications during a session. Of course the swapfile may grow as needed, but until then I've got about 20MB of disk space back. gerrit@sequent.com writes: >Several people ask why the swap file is larger than it seems to need to >be and if it can be smaller than it is. First, it is statically allocated >to the size specified in /etc/swaptab at boot. The way I read the documentation, at boot time the swap file is pruned back to the "lowat" size if it is larger. During run time, the swap file is not allowed to exceed the "hiwat" size. There is no "static allocation" at boot time. >However, by staking out a claim to 16 or 20 Meg from >the very beginning, you can lessen the chance that your application will >be killed due to lack of swap space when your disk fills up. The minfree setting for the disk should cover your butt. User applications should complain about "disk full" long before the operating system exhausts all disk space. >You could probably even make the size of the swap file as small as 12 meg >without noticing any real differences for a while (I haven't tried this one >though). The catch is that if you do any "real" work on the machine (i.e. >using more than 4-5 NeXT Apps at a time), the swap file is quite likely to >grow back to what it used to be. If you've got enough memory, I'd recommend cutting back the swap file. 24MB RAM + 1MB swap is much faster than 8MB RAM + 20MB swap (especially on optical!) >Running out of swap space can cause all kinds of bad things to happen, so >it is better to run out of disk space with a comfortable size swap file >allocated. I don't think running out of swap on the NeXT will be as much of a problem as on other unix machines. The NeXT swaps to a file, which can grow to fill the available space. Your applications will complain before you get too far. On systems where there is a swap partition, once that partition fills you're hosed. And you may not have much indication of when that is happening, other than poor system performance. In summary, I can't think of a reason not to prune the swap file. It should give you an idea of what your real memory requirements are. -- Jim Wright jwright@cfht.hawaii.edu Canada-France-Hawaii Telescope Corp.