[comp.unix.ultrix] what exactly is "wasted swap space"

envbvs@epb7.lbl.gov (Brian V. Smith) (02/06/91)

I have several Vaxstations, some II's and some 2000's.  For some reason
on one (only one) of the 2000's, we are seeing a LOT of "wasted" swap space.
Each time I start an xterm (X11R4, MIT) approximately 500k more is put in
the "wasted" category by pstat -s.  
On all 6 of our other machines, only 128k is "wasted" for each xterm started.
Moreover, the amount "used" according to pstat, is about 1000k for each xterm
vs 700k on our other machines.
All are running Ultrix 3.0.
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:

22864k swap configured
        21894k used (2457k text, 0k smem)
        968k free, 9004k wasted, 2k missing
avail: 2*256k 1*128k 1*64k 3*32k 2*16k 136*1k

-- 
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL; they don't pay me enough for that.

alan@shodha.enet.dec.com ( Alan's Home for Wayward Notes File.) (02/06/91)

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