System Administration Guide: Advanced Administration

How to Check Unused Memory (sar -r)

Use the sar -r command to report the number of memory pages and swap-file disk blocks that are currently unused.


$ sar -r
00:00:00 freemem freeswap
01:00:00    2135   401922

The following table describes the output from the -r option.

Table 24–16 Output From the sar -r Command

Field Name 

Description 

freemem

The average number of memory pages that are available to user processes over the intervals sampled by the command. Page size is machine-dependent. 

freeswap

The number of 512-byte disk blocks that are available for page swapping. 

Example—Checking Unused Memory

The following example shows output from the sar -r command.


$ sar -r
SunOS touchstone 5.9 Generic sun4u    03/04/2003

00:00:00 freemem freeswap
01:00:00    3454   834587
02:00:00    3449   834549
03:00:00    3446   834552
04:00:00    3440   834722
05:00:00    3433   834535
06:00:00    3432   834557
07:00:00    3426   834526
08:00:00    3423   834502
08:20:01    3425   835158
08:40:00    3421   834453
09:00:00    3422   834473
09:20:01    2455   817457
09:40:01     651   768238
10:00:02     862   748302
10:20:03     373   713652
10:40:01     506   717459
11:00:01     668   716669
11:20:01     537   715802

Average     2907   815627