Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!emory!gatech!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.programmer Subject: Re: Memory fragging Message-ID: <21795@cbmvax.commodore.com> Date: 22 May 91 17:51:29 GMT References: <1991May21.195251.16477@zorch.SF-Bay.ORG> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore-Amiga, Inc. West Chester, PA. Lines: 26 In article <1991May21.195251.16477@zorch.SF-Bay.ORG> mike@zorch.SF-Bay.ORG (Mike Smithwick) writes: >[Attack of the killer poodles!] > >I am using loads of chip ram and it seems to be fragging pretty badly. So much >so that I can't run the program more than a couple of times without having >to reboot. I am not running any other programs at the same time so there is >no outside interference. Theoretically I should return to the same state >as I had before, I am not. Do as much as you can to free your resources in the reverse order that you obtained them in. Avoid using FreeRemember(FALSE). Avoid doing Alloc(A);Alloc(B);Alloc(C), ... , Free(B). If you do lots of allocations and frees of a fixed size, try to code up some kind of pool allocation scheme. Make sure you free all your resources. >mike Peter -- Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "If all you have is a hammer, everything looks like a nail."