Date: Thu, 23 Mar 2000 01:17:50 GMT From: "Kave p.Ram" <hotkaveh@hotmail.com> To: questions@freebsd.org Subject: memory management in BSD Message-ID: <20000323011750.70637.qmail@hotmail.com>
next in thread | raw e-mail | index | archive | help
Hi ! i did some cool/crazy experiments with malloc(3) and free(3) and watched the whole show in another terminal running ` /usr/bin/top ' it leaves a lot of questions on my mind which concludes that i have a lot to learn on memory management. thanx to Alfred Perlstein & Dirk Myers for highlights . regards, /kave >From: Alfred Perlstein <bright@wintelcom.net> >To: "Kave p.Ram" <hotkaveh@hotmail.com> >CC: questions@FreeBSD.ORG >Subject: Re: memory management in BSD >Date: Wed, 22 Mar 2000 16:05:27 -0800 > >* Kave p.Ram <hotkaveh@hotmail.com> [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 >From: Dirk Myers <dirkm@teleport.com> >I'm not 100% sure what you're asking, but here's a try at an answer. > >The operating system keeps track of which parts of memory it's >promised to which process. When the process exits, all the memory >promised to that process is available to the system. > > > thanx for any suggestion :-) > >I hope this is what you're asking. For details, see _The Design >and Implementation of the 4.4BSD Operating System_. > >Dirk dirkm@teleport.com >-- >There's a fine line between cleverness and idiocy. ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000323011750.70637.qmail>