Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!lfcs!nick From: nick@lfcs.ed.ac.uk (Nick Rothwell) Newsgroups: comp.sys.mac.system Subject: Re: Memory (de)fragmentation Message-ID: <4372@castle.ed.ac.uk> Date: 31 May 90 10:08:46 GMT References: <16797@phoenix.Princeton.EDU> <1990May29.145842.18701@kth.se> Reply-To: nick@lfcs.ed.ac.uk (Nick Rothwell) Organization: Jenny Agutter Appreciation Society of Edinburgh Lines: 32 In-reply-to: juh@cs.hut.fi (Juha Hyv|nen) In article , juh@cs (Juha Hyv|nen) writes: >Why can't (application) heaps move? Is it the same in all (operating) >systems or is it just the way Apple choose to do? Because the applications will have pointers to things in the heap, so their addresses mustn't change. The whole point behind handles is that stuff can be moved transparently under the application under certain well-defined circumstances (when the application is required not to hold onto dereferenced handles). Even so, there's a call to create a *pointer* to a heap object, and handles can be locked, so the problem is still there. Moving an entire application around is, I would surmise, much more complicated. I don't know of any systems which can move application data areas in physical memory without using handles or somesuch. Moving code is sometimes achievable since code can usually be made position-independent and relocatable. Virtual memory solves these problems, of course, since then the fragmentation of the application's memory is virtual (sic), and shouldn't cause physical fragmentation; things can be moved in physical memory (or to/from disk) without the virtual addresses changing. This implies that VM makes the whole handles business obselete (yes?) Nick. -- Nick Rothwell, Laboratory for Foundations of Computer Science, Edinburgh. nick@lfcs.ed.ac.uk !mcsun!ukc!lfcs!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ Ich weiss jetzt was kein Engel weiss