From owner-freebsd-questions@FreeBSD.ORG Sun Mar 6 20:47:18 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FBE916A4CE for ; Sun, 6 Mar 2005 20:47:18 +0000 (GMT) Received: from smtp-vbr15.xs4all.nl (smtp-vbr15.xs4all.nl [194.109.24.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 502EB43D31 for ; Sun, 6 Mar 2005 20:47:17 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) j26KlF4U052572; Sun, 6 Mar 2005 21:47:16 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id DF24960ED; Sun, 6 Mar 2005 21:19:25 +0100 (CET) Date: Sun, 6 Mar 2005 21:19:25 +0100 From: Roland Smith To: freebsd-questions@freebsd.org Message-ID: <20050306201925.GA70082@slackbox.xs4all.nl> Mail-Followup-To: freebsd-questions@freebsd.org, Anthony Atkielski References: <1108086284.20050306153626@wanadoo.fr> <20050306164018.GB68992@slackbox.xs4all.nl> <1718332183.20050306183745@wanadoo.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <1718332183.20050306183745@wanadoo.fr> User-Agent: Mutt/1.4.2.1i X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! Organization: Me, organized? X-Virus-Scanned: by XS4ALL Virus Scanner cc: Anthony Atkielski Subject: Re: What's the minimum memory for a process in FreeBSD 5.3? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2005 20:47:18 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 06, 2005 at 06:37:45PM +0100, Anthony Atkielski wrote: > Roland Smith writes: >=20 > > Shared libraries, stack space, heap space. >=20 > Why would shared libraries be charged against the process--they should > be common to every process, right? As I understand it (correct me if I'm wrong), there is only one instance of a shared library in memory. But it is mmapped into the address space of every process that uses it. > How much stack and heap space is allocated by default, and is it > individually or globally configurable? In a typical process layout in memory, the code (text), initialized data (data) and uninitialized data (bss) are on the low end of the virtual address space (typically starting at page 1), with the heap growing up. The environment, arguments and stack are at the top of the address space, with the stack growing down. Stack and heap space for a process are extended by the kernel as needed. There is a stack limit that can be set with ulimit. Execute 'ulimit -a' to see what is it. So you can set this value, but I'm not sure if this is wise. Setting this limit lower will not make the amount of memory that they use smaller, but they will probably page-fault if they hit the stack limit. I'm not sure that's the behavior you're looking for. :-) Shared libraries are mmaped between the heap and the stack limit, and their pages are marked read-only, AFAIK. Roland --=20 R.F. Smith /"\ ASCII Ribbon Campaign r s m i t h @ x s 4 a l l . n l \ / No HTML/RTF in e-mail http://www.xs4all.nl/~rsmith/ X No Word docs in e-mail public key: http://www.keyserver.net / \ Respect for open standards --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCK2XNEnfvsMMhpyURAthoAJ40eDvwjsC7Bh68b5LD4qGR9156RACgl22I Fw7PynkJnzPr8MeWlvoajOA= =l4X8 -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR--