Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!well!ewhac From: ewhac@well.UUCP (Leo L. Schwab) Newsgroups: comp.sys.amiga.tech Subject: Re: CloseFonts() problems Summary: How to get your memory back. Message-ID: <10097@well.UUCP> Date: 23 Dec 88 08:13:01 GMT References: <3599@tekig5.PEN.TEK.COM> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Klein Bottle Wanted; Inquire Within. Lines: 27 Quote: "The Plain Man's Guide to Alien Invasion." -- Avon In article <3599@tekig5.PEN.TEK.COM> wayneck@tekig5.PEN.TEK.COM (Wayne Knapp) writes: >I'm working on a program that makes massive use of fonts. The problem >I have is that once a font is loaded into memory, it stays there forever. >[ ... ] >Seemly the CloseFont() call dose not ever release the font from memory. >[ ... ] Dose [sic] anyone know what is wrong? > Nothing is wrong. Fonts are rather like libraries; they hang around in memory until memory becomes short. The reason it does this is so that it doesn't have to load them off disk every time they're opened. The fonts and libraries will be purged from memory when the memory is needed. 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)). However, in the process of trying to satisfy this request, Exec will make room in memory by flushing out all loaded fonts and libraries that aren't in use. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape INET: well!ewhac@ucbvax.Berkeley.EDU \_ -_ Recumbent Bikes: UUCP: pacbell > !{well,unicom}!ewhac O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack") "Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor