Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Handles and Virtual Memory Message-ID: <9415@hoptoad.uucp> Date: 26 Dec 89 23:14:41 GMT References: <3875@atr-la.atr.co.jp> <4525@helios.ee.lbl.gov> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 38 In article <4525@helios.ee.lbl.gov> beard@ux1.lbl.gov (Patrick C Beard) writes: >With virtual memory on the horizon, Handles may not be long for this world. Generally a good message, but I wanted to take issue with this. In the new Mac virtual memory system, applications can't increase their heap allocations at runtime. Therefore, heap fragmentation can still be a problem, and handles remain important. It is a mistake to extrapolate from other VM systems to the Mac's, which is rather limited. For instance, under ordinary VM, a RAM-based editor is automatically a disk-based editor. Many large documents can be kept in RAM, apparently, even though in fact they are being kept largely in paging space on the disk. With the Mac VM system, though, you are limited to your initial allocation of RAM. So a RAM-based editor does not approximate to the performance of a disk-based editor, and you would still be well advised to handle your own temporary files, purgeable lines, and so forth. I am also a bit concerned about the performance of the Memory Manager under VM. The Mac uses a linked-list block allocation scheme, which involves searching through linked lists of free blocks in RAM for allocation operations. This is suboptimal for a VM system -- there may be a lot of paging overhead as you go through the linked list, and your page reference counts will be affected strangely. For VM, it is generally better to use an index-based allocator, where the information on free blocks is kept separate from the blocks themselves and concentrated in a few pages of indices. This way, free blocks do not have to be paged in to be checked for suitability. Does anyone have any information on the performance impact of the Mac MM algorithm under VM? -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "Because there is something in you that I respect, and that makes me desire to have you for my enemy." "On those terms, sir, I will accept your enmity or any man's." - Shaw, "The Devil's Disciple"