Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 1999 18:23:01 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bernie Doehner <bad@wireless.net>
Cc:        Terry Lambert <tlambert@primenet.com>, hackers@FreeBSD.ORG
Subject:   Re: limiting per process swap space utilization like Solaris ulimit?
Message-ID:  <199901140223.SAA16315@apollo.backplane.com>

next in thread | raw e-mail | index | archive | help
:On Wed, 13 Jan 1999, Terry Lambert wrote:
:
:> > Why is it that under bash's ulimit -v, the swap space utilization is the
:> > sum of the data segment size and the stack size?
:> 
:> Read-only pages don't need to be backed by swap?
:
:Actualy I already asked the very same question in a different forum.  I
:assume the text segment is NOT swapped out because it is referenced way
:TOO often to be practical/efficient to swap out?
:
:> > Is this correct / valid for all shells (not just bash, which explicitly
:> > prints this out as the per process swap space limitation)?
:> 
:> On machines where the program image is not used as a read-only
:> swap store, this would be different.  You may have to install an
:> old copy of Xenix or SVR3.2 to find such a machine, though...
:> 
:
:Actualy I think Solaris does this too..
:
:Thanks.
:
:Bernie

    Only memory that does not otherwise have backing store is swapped.
    Other memory is backed by the original object - the system simply
    syncs the page if necessary and then frees it.  If the program
    needs the page again, the system reloads it.

    If the system wishes to reuse idle unbacked memory, swap space
    is allocated for it and the page synced to swap before being freed
    for reuse.

    A slight aberration of this occurs when you have MAP_PRIVATE 
    mapped pages - in this case the system uses the backing store 
    that already exists for the page until you make a modification,
    then uses swap to back your modifications.  These types of
    pages are used to fixup vectors for shared libraries and to
    map the DATA portion of a program binary.

					-Matt

					Matthew Dillon 
					<dillon@backplane.com>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901140223.SAA16315>