From owner-freebsd-questions Tue Feb 25 9:43:27 2003 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 28A7D37B401 for ; Tue, 25 Feb 2003 09:43:26 -0800 (PST) Received: from mail.slipstreamdata.com (mail.slipstreamdata.com [64.7.136.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43F8943FD7 for ; Tue, 25 Feb 2003 09:43:25 -0800 (PST) (envelope-from sahmed@slipstreamdata.com) Received: from moleman (moleman.office.slipstream.net [192.168.0.28]) by mail.slipstreamdata.com (8.12.6/8.12.6) with ESMTP id h1PHhO5G019562 for ; Tue, 25 Feb 2003 12:43:24 -0500 (EST) (envelope-from sahmed@slipstreamdata.com) From: "Salmaan Ahmed" To: Subject: .text area copy-on-write (COW) Date: Tue, 25 Feb 2003 12:43:19 -0500 Message-ID: <00b001c2dcf5$656dd430$1c00a8c0@office.slipstream.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'm trying to determine just how much *physical* memory is required by one of my programs. I have a simple program with a .text size of about 1.7MB and, when running, a resident memory size of about 2.3MB. So far so good. What I don't understand is that when this program fork()s, shouldn't the .text area be shared between parent and child (actually, shouldn't both .text and .data be shared until modified)? If so, then why does the child process also have a resident memory ("RES" under "top") of 2.2MB instead of 600k? Am I misreading "top"? Is there some other way of determining the amount of physical memory being used by a process? Salmaan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message