DECUS Essential Tools Collection, 1996 for OpenVMS Alpha and OpenVMS VAX (VS0174)


  APFRAG is a rewrite of PFRAG, from MACRO-32 to DEC C for Alpha.

  APFRAG is a utility that  will report on the health of your page and
swap files. It will list the name, size, pages (real pages, not
pagelets!) used, allocation factor (size of IO that the MPW will use
to write pages to the file), and the number of holes (unallocated
chunks). It will print a list of the sixteen largest holes in each
page file. It will also list the minimum free count that has occurred,
and the number of remaining "reservable" pages. It also prints the
number of processes referencing the file (both for page and swap), and
the number of processes using it as a swap file. 

  Do not confuse Page file fragmentation with disk file fragmentation!
Page file fragmentation refers to the internal fragmentation of
allocatable pages within a (usually, mostly) contiguous page file. 

  Page file fragmentation was the cause of VMS V4 systems that would 
run fine for a few hours or days, after a boot, then gradually slow 
down, for no apparent reason.

  Note that APFRAG lists all sizes as PAGES, which will be a variable
number of BLOCKS and PAGELETS on assorted versions of the Alpha
architecture (on my 3000-500, it's 16 blocks per page). I could have
multiplied it out to "pagelets", but felt that this would obscure the
extent of the fragmentation reporting. 


  Thanks to Ehud Gavron, Patrick Mahan, and Hunter Goatley, for 
assistance with Alpha and C issues.


  Files included:

aaareadme.doc		this file
alphapagelocker.c	C routine that locks code down
apfrag.c		main program source
apfrag.com		compiles, assembles, and links from source
apfrag.h		defs for apfrag
apfrag.opt		options file for linking
apfraglock.c		C routines that use KRNL mode, spinlocks, high ipl
ddbdef.h		header file for DDBs
fcbdef.h		  "     "    "  FCBs
pfldef.h		  "     "    "  PFLs
sbdef.h			  "     "    "  system blocks
splocks.mar		MACRO-32 for acquiring the mmg spinlock
ucbdef.h		header file for UCBs
wcbdef.h		  "     "    "	WCBs


  To build APFRAG from the sources, set your default to the directory the
files are in, and...

$ @apfrag
$ run apfrag

  Time for a disclaimer, so here goes...these routines change modes to
KERNEL, switch to high IPL, and take out spinlocks, so there is a a
chance that a system crash could occur.

  If they cause any problems on your systems (or you have suggestions
for enhancements), I would like to hear about it, that I may fix any
bugs, but, Control-G Consultants and I take no responsibility for any
problems that occur. 

Lee K. Gleason N5ZMR
Control-G Consultants
1734 Wakefield
Houston TX 77098

713/681-3985
gleason@mwk.uucp

Click on FTP to download from the FTP archives.
[FTP]