Subject: Re: Swap overcommit (was Re: Replacement for grep(1) (part 2))
To: Noriyuki Soda <soda@sra.co.jp>
From: Matthew Dillon <dillon@apollo.backplane.com>
List: tech-userlevel
Date: 07/15/1999 11:25:39
::    -s             Print summary information  about  total  swap
::                   space usage and availability:
::
::                      allocated   The total amount of swap space
::                                  (in      1024-byte     blocks)
::                                  currently allocated for use as
::                                  backing store.
::
::                      reserved    The total amount of swap space
::                                  (in   1024-bytes  blocks)  not
::                                  currently    allocated,    but
::                                  claimed by memory mappings for
::                                  possible future use.
::
::                      used        The total amount of swap space
::                                  (in  1024-byte blocks) that is
::                                  either allocated or reserved.
:--
:soda

    It would be really easy to test this.

    Write a program that malloc's 32MB of space and touches it,
    then sleeps 10 seconds and forks, with both child and parent
    sleeping afterwords.  ( the parent and the forked child should
    not touch the memory after the fork occurs ).

    Do a pstat -s before, after the initial touch, and after
    the fork.  If you do not see the reserved swap space jump
    by 32MB after the fork, it isn't what you thought it was.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>