Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!deccrl!news.crl.dec.com!shlump.nac.dec.com!pa.dec.com!shodha.enet.dec.com!alan From: alan@shodha.enet.dec.com ( Alan's Home for Wayward Notes File.) Newsgroups: comp.unix.ultrix Subject: Re: what exactly is "wasted swap space" Summary: The wrong algorithm for the right job. Message-ID: <2459@shodha.enet.dec.com> Date: 6 Feb 91 03:59:01 GMT References: <9558@dog.ee.lbl.gov> Organization: Digital Equipment Corp. - Colorado Springs, CO. Lines: 41 In article <9558@dog.ee.lbl.gov>, envbvs@epb7.lbl.gov (Brian V. Smith) writes: > [ The author has observed "wasted" page/swap space on V3.0 and > wants to know what it is. ] > Why is there "wasted" swap space? > > Can anyone shed any light on what is happening? I will be glad to provide > more details if necessary. Here is the output from pstat -s: In V3.1 and earlier page/swap allocated via an algorithm that would use successively larger values as more space was needed. Two values, configurable in recent version, were used to determine how the space was allocated. The first allocation would be for "dmmin", typically 16 KB. The next allocation would be for dmmin*2, followed by dmmin*4, dmmin*8 and so on until "dmmax", which was usually 512 KB. Once the allocation size reached dmmax it would be used until the max process size was reached and you got some variation of the message, "out of core". The problem with this algorithm is that it tends to waste lots of space for big allocations (most X programs for example). If your program needed something less than 16 KB then that's all that would be allocated. But if you needed 17, then 48 KB would be allocated (16+32). The space that is wasted is the difference between what is allocated and actually used. In V4.0 one size, swapfrag, is used for all allocations. Rather than being a function of dmmin and dmmax the max sizes of a process are controlled by there configuration paramaters; maxtsiz for text, maxdsiz for data and maxssiz for stack. One other change of note in V4.0 is that rather than allocating space initially ULTRIX only reserves it. The allocation is done when a process needs to page or be swapped. > > -- > Brian V. Smith (bvsmith@lbl.gov) > Lawrence Berkeley Laboratory -- Alan Rollow alan@nabeth.cxn.dec.com