Sticky bit -- To set or not to set.

Dennis L. Mumaugh dlm at cuuxb.ATT.COM
Tue Apr 26 09:12:23 AEST 1988


In article <3571 at gryphon.CTS.COM# sarima at gryphon.CTS.COM (Stan Friesen) writes:
#In article <13085 at brl-adm.ARPA# "oread::barbanis"@coins.cs.umass.edu writes:
##
##Is there any reason at all to have the sticky bit on in an executable?
##Or, to put it differently, under what circumstances should it be set?
##(circumstances such as program size, hardware/OS, program usage
##pattern, etc.)
# ......
#	The sticky bit should be set *only* for very heavily used programs
#that are not in continuous use. It is intended to help reduce the startup
#overhead of major system utilities, like vi, especially moderately large ones.
#WARNING: setting the sticky bit uses up swap space and RAM, so make sure you
#have enough of both to handle ALL sticky programs plus any normal user program
#mix that you can foresee. Thus on most systems only vi/ex and perhaps the
#shells need or should have the sticky bit set. On some turnkey systems it
#might be useful to make the main user application sticky as well.

The sticky bit is  ONLY  meaningful  for  swapping  machines.  On
demand paging it doesn't make much sense.  It was used because the
"text" for a program was scattered on the disk (as  a  file).  It
was fully loaded into core (no partial loads on  swapping).  The
text would then (we hope) be copied onto the  swap  disk  as  one
contiguous image.  Hence loading it from swap was much faster (if
the disk driver and hardware allowed a single transfer).

With demand paging the disk file is page aligned  and  the  pages
are swapped in from the file system as required and not placed on
the swap/page device unless modified.  Hence the sticky bit isn't
of much use.

Also VERY heavy programs such as shells  never  need  the  sticky
bit.  Consider  the  shell.  It is always in use.  Hence its text
is around.


-- 
=Dennis L. Mumaugh
 Lisle, IL       ...!{ihnp4,cbosgd,lll-crg}!cuuxb!dlm



More information about the Comp.unix.wizards mailing list