From owner-freebsd-questions Wed Mar 22 15:42: 7 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 5D62737B692 for ; Wed, 22 Mar 2000 15:42:04 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e2N05RW21733; Wed, 22 Mar 2000 16:05:27 -0800 (PST) Date: Wed, 22 Mar 2000 16:05:27 -0800 From: Alfred Perlstein To: "Kave p.Ram" Cc: questions@FreeBSD.ORG Subject: Re: memory management in BSD Message-ID: <20000322160527.C21029@fw.wintelcom.net> References: <20000322230800.48079.qmail@hotmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000322230800.48079.qmail@hotmail.com>; from hotkaveh@hotmail.com on Wed, Mar 22, 2000 at 11:08:00PM +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Kave p.Ram [000322 15:52] wrote: > Hi ! > > I have a question on memory management in FreeBSD . > suppose i write a bogus piece of software which just allocates > about 5 Mb of memory without freeing it later . > > if i run this software 10 times then I have allocated totally about > 50 Mb of available memory. (but not at once) > > my question is : if a dumb person like me forget to free the allocated > memory dedicated to this piece of code , how does the system (after the end > of execution ) knows that those memory areas that this software used is free > to reuse ? When the program exits its memory will be free'd back to the system, if the program doesn't exit and the memory is needed, it's likely that the memory will be swapped out to disk, if you run out of swap and memory the system is likely to get cranky and nuke a process in order to free up some resources. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message