Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!olivea!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Why do application partitions exist? Message-ID: <48874@apple.Apple.COM> Date: 6 Feb 91 02:06:48 GMT References: <1991Feb5.182501.4325@wam.umd.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 41 In article <1991Feb5.182501.4325@wam.umd.edu> nebel@wam.umd.edu (Chris D. Nebel) writes: >I got to wondering about this one late one night: why does Multifinder have >this business of application partitions? Why couldn't it have been written >so that all applications simply share one big heap zone? This would have >a number of advantages: users don't have to know anything about partition >sizes, you don't have wasted memory because of apps only using small portions >of their partition, having enough contiguous free memory to run a program >becomes much less of a problem, and programmers don't have to worry about >special Multifinder temporary memory. > >The only problem I could think of was that the system has to know who created >which blocks, so it can know what to throw away when a program quits >("unexpectedly" or otherwise). It seems to me, though, that this would be >fairly easy to do, and it wouldn't break anything that didn't use fake handles >or rely on the format of block headers, which they shouldn't have been doing >anyway. > >Since this scheme is obviously :) so much better and is trivial :) :) to >implement, why wasn't it done? Am I missing something obvious? The Mac memory model consists of a system heap and an application heap. Apps are written with this model in mind. The MultiFinder model is the same in that from an app's perspective, it still has a system and application heap. Having one big heap actually complicates the situation. Picture several apps running in a common heap competing for memory. How does an app determine if it has enough memory to run when another app could soon gobble up a big chunk of the heap? How does the system manage ownership of heap blocks? While you do occasionally need to tweak the partition size, it's usually set correctly for most applications, and if it's not, a quick change in the Finder will fix it permanently... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen | Apple Computer, Inc. | Disclaimer: | 20525 Mariani Ave, MS-81CS | the above may be stevec@apple.com | Cupertino, CA 95014 | a lie...or not.