Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!rutgers!att!mtuxo!mtfmi!mec From: mec@mtfmi.att.com (M.CONNICK) Newsgroups: comp.sys.mac Subject: Re: RAM cache size Message-ID: <1121@mtfmi.att.com> Date: 25 May 89 13:05:42 GMT References: <1260@marvin.Solbourne.COM> <11353@netnews.upenn.edu> Reply-To: mec@mtfmi.UUCP (79153-M.CONNICK) Organization: AT&T Bell Labs, Middletown NJ Lines: 32 In article <11353@netnews.upenn.edu> rubinoff@linc.cis.upenn.edu (Robert Rubinoff) writes: > I have also been having problems that I think are caused by the RAM cache. > Does anyone know what it actually caches, and whether it's write-through? > > Several times I've had the machine crash and rebooted to discover that files > I had saved weren't there any more. If this is because they're somehow being > cached until some later time, this means that the RAM cache is very dangerous. > > It's nice to get the speedup the cache gives, but not at the risk of losing > files (or corrupting the disk directory). Does anyone know if there is a safe > size to set the cache that will prevent this? The Mac disk cache is not a write-through cache. But then, the UNIX system buffer cache isn't either! A bigger performance gain is obtained by not doing so. The Mac disk cache will flush file updates to disk immediately when the file is closed though. To me this is about the best compromise possible between performance and guaranteed file integrity. Even if you don't have the cache enabled, a crash before an updated file is closed will usually mean lost data, simply due to the normal buffering taking place in the Mac file system. The only way to make sure that a file is updated to disk on a record-by-record basis is to call FlushVol after every output. Of course, if you're crashing often enough for buffering/caching to be a real problem, then you really should be addressing what's causing all the crashes! ----------------------------------------------------- Michael Connick att!mtfmi!mec 201-957-3057 AT&T Bell Labs MT 3F-113 (Dept. 79153)