Article View: comp.sys.amiga.tech
Article #10753Re: CloseFonts() problems
From: Jim Mackraz
Date: Fri, 30 Dec 1988 18:40
Date: Fri, 30 Dec 1988 18:40
60 lines
3393 bytes
3393 bytes
In article <14355@oberon.USC.EDU> papa@pollux.usc.edu (Marco Papa) writes: )In article <YXienJy00Vsf0AHTAo@andrew.cmu.edu| mp1u+@andrew.cmu.edu (Michael Portuesi) writes: )|ewhac@well.UUCP (Leo L. Schwab) writes: )|| You can force the system to purge all loaded fonts and libraries )|| that are not currently in use by trying to allocate four gigabytes of RAM: )|| AllocMem (4000000000L, NULL); )|| This will always fail (unless you actually happen to *have* four )|| gigabytes of RAM hanging around (or if AmigaDOS/Kickstart ever goes )|| virtual)). )|Perhaps better would be an Exec call to automatically flush non-used )|libraries and fonts from memory. Does one exist? ) ^^^^^^^^^^^^^^ )Nope. ) )|Is it a good idea for random programs to be flushing things that might be )| better off cached? ) )Well, I can tell you that the practice Leo refers to is widely used since it )is the ONLY way to flush things and force memmory merge. I use it myself. )The performance penalty is in my opinion not that big. An Exec call that )ASKED for a flush would be nice, though. (1.4? Dale?, Jimm?). ) )-- Marco Papa 'Doc' Hold on, here, fellas. Is there a real reason to flush the font? This thread started when some guy thought the memory for an unused font was unavailable. It's not unavailable, it's just unpurged. If you NEED the memory, won't you get it when you try to allocate it? If you need a large chunk of memory, won't an expunge happen when you try to get it? This isn't so that your customers feel that you've returned all your memory, is it? Or maybe to satisfy the BKDC rules or something. We've identified some problems in the Expunge processing, but you are going against the general principle. Ask for what you need. The system should expunge things if necessary to satisfy your requests. Problems I'm aware of include: 1) Expunge should walk the device/libs lists in reverse order so that if one library is opened by another, the opener hears the expunge first. (discovered by Bill Hawes, the little genius). 2) Expunging should terminate when it gets enough memory for the AllocMem. 3) Some device (serial maybe) hangs onto resources until it is expunged, so expunging it is the only way to get the resources back (this would be a bug in the device). If you want to check your memory usage, select 'flushlibs' from the secret WB menu (LoadWB -debug), don't put a gratuitous huge allocation in your program. The whole point is to NOT expunge things unless the memory is really needed. If I'm missing something here, I'd be pleased to be educated. jimm -- Jim Mackraz, I and I Computing amiga!jimm BIX:jmackraz Opinions are my own. Comments regarding the Amiga operating system, and all others, are not to be taken as Commodore official policy.
Technical Details
Message-ID:
<3226@amiga.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!amiga!jimmReferences:
<3599@tekig5.PEN.TEK.COM> <10097@well.UUCP> <YXienJy00Vsf0AHTAo@andrew.cmu.edu> <14355@oberon.USC.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!oliveb!amiga!jimm From: jimm@amiga.UUCP (Jim Mackraz) Newsgroups: comp.sys.amiga.tech Subject: Re: CloseFonts() problems Message-ID: <3226@amiga.UUCP> Date: 30 Dec 88 18:40:18 GMT References: <3599@tekig5.PEN.TEK.COM> <10097@well.UUCP> <YXienJy00Vsf0AHTAo@andrew.cmu.edu> <14355@oberon.USC.EDU> Reply-To: jimm@cloyd.UUCP (Jim Mackraz) Organization: Commodore-Amiga Inc, Los Gatos CA Lines: 60