Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!godzilla!nujoizey!gwu From: gwu@nujoizey.tcs.com (George Wu) Newsgroups: comp.lang.c++ Subject: Re: fragmentation of free store Keywords: free store, new, delete Message-ID: <1986@godzilla.tcs.com> Date: 3 Apr 91 05:52:09 GMT References: <285@paradim.UUCP> Sender: root@tcs.com Reply-To: gwu@nujoizey.tcs.com (George Wu) Organization: Teknekron Communications Systems Lines: 45 In article <285@paradim.UUCP>, jean@paradim.UUCP (Jean Pierre LeJacq) writes: |> The free store memory managment system can coalesce |> deleted memory to form larger blocks. However, it |> does not appear possible to defragment this memory |> due to direct references to free store memory. |> |> If this is the case free store memory allocation |> could fail even when plenty of fragmented memory is |> available. Thus even programs that carefully delete |> memory when no longer required could fail if run |> for a sufficiently long period of time. |> |> It would thus appear necessary to provide class |> specific new and delete for any real application. |> Am I missing something in this analysis (e.g. only |> indirect references to free store memory)? Am I dated, here? Jean Pierre's article seems to indicate there is an implemented solution to memory fragmentation, but for some reason I don't understand, this solution is not wholey effective. Anyways, the remainder of this message is based upon the assumption that no one has yet bothered to implement a way to coalesce multiple memory fragments into a larger single chunk of memory. Fragmented memory has long been a problem in UNIX, not just C++. At least up through BSD 4.3, the only reason our VAXen at C-MU ever came down was because the kernel's free list was full of tiny fragments rather than larger, usable chunks of memory. After a couple of months, we'd simply have to reboot the machine because the system had no way of coalescing the pieces. While I don't know for certain, nearly all other UNIX variants must have the same problem. The fault tolerant flavors are the most likely to have attacked this. Therefore, while overloading new and delete to coalesce freed bits of memory will help, to really solve the problem, you need to fix the problem in the kernel as well (unless your application is clearly *the* primary, almost sole, program to be run on the machine). George ---- George J Wu, Software Engineer | gwu@tcs.com or uunet!tcs!gwu Teknekron Communications Systems, Inc.| (415) 649-3752 2121 Allston Way, Berkeley, CA, 94704 | Quit reading news. Get back to work.