Re: where did all my memory go? (file system cache)

From: Chris Hodgins <chodgins_at_cis.strath.ac.uk>
Date: Thu, 17 Feb 2005 01:55:25 +0000
Julian Elischer wrote:
> slightly off topic but..
> 
> Brooks Davis wrote:
> 
>> On Wed, Feb 16, 2005 at 01:13:13PM -0800, Sean McNeil wrote:
>>  
>>
>> The concept that most of your memory should be entierly free when the
>> system is not under load is simply wrong.  The simplistic world view of
>> memory being allocated to a specific task or entierly free simply isn't
>> correct for all that it makes for nice graphs anyone can pretend they
>> understand.  You can produce some sort of aproximation of the output you
>> see on other systems by modifying the program to include inactive memory
>> in free memory.  That's what I did with Ganglia.
>>
> 
> what I really want is a way to FORce certain pages out of cache.
> In particular I need to verify teh correctness of the version on 2ndary 
> storage..
> 
> what I want is:
> 
> int fd = open("myfile",...);
> write1GBfiletodisk(fd, data);
> ioctl(fd, PURGEFROMCACHE);
> perform_md5(fd);
> 
> and be sure that teh MD5 is that of what is on the disk.
> not what is in RAM.
> 
>>
>> -- Brooks
>>
>>  
>>
> 
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> 

IANAE but could you not use the O_DIRECT flag with open?

O_DIRECT        eliminate or reduce cache effects

HTH
Chris
Received on Thu Feb 17 2005 - 00:51:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:28 UTC