Disk or memory-related problem
Just as a large fraction of real memory is available for buffering files, the system's page space is available as temporary storage for program working data that has been forced out of RAM.
vmstat -s >temp.file # cumulative counts before the command
time $1 # command under test
vmstat -s >>temp.file # cumulative counts after execution
grep "pagi.*ins" temp.file >>results # extract only the data
grep "pagi.*outs" temp.file >>results # of interestThe vmstatit script summarizes the voluminous vmstat -s report, which gives cumulative counts for a number of system activities since the system was started.
# vmstatit "cp file1 file2" 2>resultsreal 0m0.03s
user 0m0.01s
sys 0m0.02s
2323 paging space page ins
2323 paging space page ins
4850 paging space page outs
4850 paging space page outsvmstat -s >temp.file
time $1
vmstat -s >>temp.file
echo "Ordinary Input:" >>results
grep "^[ 0-9]*page ins" temp.file >>results
echo "Ordinary Output:" >>results
grep "^[ 0-9]*page outs" temp.file >>results
echo "True Paging Output:" >>results
grep "pagi.*outs" temp.file >>results
echo "True Paging Input:" >>results
grep "pagi.*ins" temp.file >>resultsreal 0m2.09s
user 0m0.03s
sys 0m0.74s
Ordinary Input:
46416 page ins
47132 page ins
Ordinary Output:
146483 page outs
147012 page outs
True Paging Output:
4854 paging space page outs
4854 paging space page outs
True Paging Input:
2527 paging space page ins
2527 paging space page insThe time command output confirms the existence of an I/O dependency. The increase in page ins shows the I/O necessary to satisfy the cp command. The increase in page outs indicates that the file is large enough to force the writing of dirty pages (not necessarily its own) from memory. The fact that there is no change in the cumulative paging-space-I/O counts confirms that the cp command does not build data structures large enough to overload the memory of the test machine.
The order in which this version of the vmstatit script reports I/O is intentional. Typical programs read file input and then write file output. Paging activity, on the other hand, typically begins with the writing out of a working-segment page that does not fit. The page is read back in only if the program tries to access it. The fact that the test system has experienced almost twice as many paging space page outs as paging space page ins since it was booted indicates that at least some of the programs that have been run on this system have stored data in memory that was not accessed again before the end of the program. Memory-limited programs provides more information. See also Memory performance.
# cc -c ed.c
# vmstatit "cc -c ed.c" 2>resultsreal 0m7.76s
user 0m7.44s
sys 0m0.15s
Ordinary Input:
57192 page ins
57192 page ins
Ordinary Output:
165516 page outs
165553 page outs
True Paging Output:
10846 paging space page outs
10846 paging space page outs
True Paging Input:
6409 paging space page ins
6409 paging space page ins# rmss -c 8real 0m9.87s
user 0m7.70s
sys 0m0.18s
Ordinary Input:
57625 page ins
57809 page ins
Ordinary Output:
165811 page outs
165882 page outs
True Paging Output:
11010 paging space page outs
11061 paging space page outs
True Paging Input:
6623 paging space page ins
6701 paging space page insThe following symptoms of I/O dependency are present:
- Elapsed time is longer than total CPU time
- Significant amounts of ordinary I/O on the nth execution of the command
# rmss -rto release back to the operating system the memory that the rmss command had sequestered, thus restoring the system to its normal capacity.