Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Memory Sweeping? Message-ID: <45779@sun.uucp> Date: 16 Mar 88 20:44:15 GMT References: <3909@cup.portal.com> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 34 Memory leaks are a nasty problem and everyone should check to see that their program gives back all the memory it takes. In article <3909@cup.portal.com> David_Bat_Masterson@cup.portal.com writes: > Is there any programs around that will sweep through memory for unused, but > not "free" memory (memory for some reason or another should be on the free > list, but didn't make it there)? The mechanics of this aren't to tough to write, but how do you propose to determine if memory is 'supposed' to be free? There is no description of task address spaces so there is no way to determine who 'owns' the memory. > Often after I run programs, I find that >the Workbench memory indicator shows less memory than when I started the >programs. This does not happen all the time, even when using the same >program (perhaps I did something different inside the program). Sometimes >this memory loss can be upwards of 70K-80K, but, since I have 3Meg of memory >on an B2000, I haven't been paying much attention to this "loss". Sometimes programs bring fonts or libraries into memory when they run, these are not immediatly freed because some other program may want to use them. The next time a memory request comes through requesting more memory than is available then they will be expunged. A little known option on the workbench is the 'debug' switch. If you start workbench in your cli with the line : LoadWB -debug Then an invisible menu will appear after the 'Special' menu header. One of its options is 'flush libs' which will flush out any libraries that aren't being used but are still resident in ram. So try running your program, then flush libs, and then check to see if the same amount of memory is available as before. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.