ComputeWorkingSetDoc.tioga
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bob Hagmann, May 15, 1986 7:55:01 am PDT
ComputeWorkingSetDoc
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
Compute Working Set
Bob Hagmann
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: Compute an approximation of the working set for a running system.
Created by: Bob Hagmann
Maintained by: Bob Hagmann <Hagmann.pa>
Keywords: Working Set
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Usage
ComputeWorkingSet {delay ← 5}
 Compute an approximation of the working set and print the statistics every ``delay'' seconds (default 5).
2. Discussion
ComputeWorkingSet looks at all physical pages in an attempt to compute the working set. Each time through the loop, it gathers statistics and turns off the ``referenced'' bit. The statistics are printed, it waits for a delay, and does the loop body again.
By messing with the ``referenced'' bit, the laundry process and the page replacement algorithm will make almost arbitrary decisions about page cleaning and replacement. Hence, do not use this program under high page traffic loads. Use a machine with a larger physical memory if necessary. Do not set the delay to be near the ``Millisecs for stats'' printed during each loop — you won't make much progress.
To use, just start up what you want to measure. In a CommandTool, use the ComputeWorkingSet command to start acquring statistics. Click STOP! to get it to stop.
Here is some sample printout. Below it is a description of what each statistic means.

%
ComputeWorkingSet

Millisecs for stats 569 free: 5138 pinned: 993 unmapped: 0
readonly: 2827 readonlyrefd: 1580 rwdirty: 2880 rwdirtyrefd: 2919
rwclean: 42 rwcleanrefd: 1 total pages: 16380
Totals -- refed 4500 unrefed: 5749 refed+pinned 5493

Millisecs for stats 409 free: 5138 pinned: 993 unmapped: 0
readonly: 4038 readonlyrefd: 369 rwdirty: 5459 rwdirtyrefd: 340
rwclean: 43 rwcleanrefd: 0 total pages: 16380
Totals -- refed 709 unrefed: 9540 refed+pinned 1702

Millisecs for stats 420 free: 5138 pinned: 993 unmapped: 0
readonly: 4047 readonlyrefd: 360 rwdirty: 5459 rwdirtyrefd: 340
rwclean: 43 rwcleanrefd: 0 total pages: 16380
Totals -- refed 700 unrefed: 9549 refed+pinned 1693
-- Aborted.
%
Millisecs for stats: how long it took to compute the stats
free: free pages in physical memory
pinned: pinned pages in physical memory (e.g., MDS, I/O buffers, display buffer, ...)
unmapped: pages probably being swapped in
readonly: pages marked read-only (almost all of which is code) that have not been referenced since the last statistics
readonlyrefd: pages marked read-only that have been referenced since the last statistics
rwdirty: pages marked read-write that are dirty and have not been referenced since the last statistics
rwdirtyrefd: pages marked read-write that are dirty and have been referenced since the last statistics
rwclean: pages marked read-write that are clean and have not been referenced since the last statistics
rwcleanrefd: pages marked read-write that are clean and have been referenced since the last statistics
total pages: sum of free + ... + rwcleanrefd (this seems to loose four pages somewhere on a Dorado)
Totals -- refed: readonlyrefd + rwdirtyrefd + rwcleanrefd
Totals -- unrefed: readonly + rwdirty + rwclean
Totals -- refed+pinned: refed+pinned