Path: utzoo!attcan!uunet!portal!cup.portal.com!dan-hankins From: dan-hankins@cup.portal.com Newsgroups: comp.sys.amiga.tech Subject: free memory defragmentation Message-ID: <9887@cup.portal.com> Date: 9 Oct 88 06:50:58 GMT Organization: The Portal System (TM) Lines: 22 XPortal-User-Id: 1.1001.5361 I am considering writing a utility to take the free memory heap and defragment it. This would involve looking at each of the nodes, reading them out into a linked list, sorting the linked list, and then concatenating all the adjacent blocks and then rebuilding the heap. This seems like such a simple idea, it amazes me that it has not occurred to anyone before. Has it? Would I be re-inventing the wheel? If so, where could I find this utility? I have a need for it. If no one has written one before, is there some quirk of the opsys that would prevent me from doing it? I already envision that the second version would intercept calls to the system allocation and de-allocation functions and run in the background, only doing the de-fragmentation when a block is returned to the heap or when an allocation request fails. Do too many programs fiddle with the heap themselves for this to be of any practical value? Dan Hankins