On 21 Feb 2011, at 4:35pm, Jim Wilcoxson wrote:

> On Mon, Feb 21, 2011 at 11:05 AM, Sven L <larvpo...@hotmail.se> wrote:
>> 
>> Thank you for your detailed explanation!
>> First, can you please tell me how to purge the cache in Windows 7? This 
>> could be very useful for my tests!
> 
> Sorry, dunno for Windows.  On Mac OSX it is the purge command, in the
> development tools.

In current versions it's just /usr/bin/purge/, which should be in your path.  
No idea why a non-programmer should need it, but there it is.

> On Linux, you do: echo 3 >
> /prog/sys/vm/drop_caches

And in Windows it's ... almost impossible.  You can sync to disk, using 
fflush(), and there's no reason you can't do this from the command-line:

http://technet.microsoft.com/en-us/sysinternals/bb897438.aspx

But for a purge you have to invalidate the contents of cache, and there's no 
way for an application to tell Windows to do this.  For a start, each 
application has its own user mode address cache, so if you run another utility 
to flush cache, it just messes with its own space.  Second, there's no system 
call that allows you access to the cache because Microsoft considers it private 
to the device level.  I am not dissing Microsoft for this: there are fair 
arguments that this is actually the Right Way to do it.

So the way to do it is to overrun the cache by yourself.  If you know your 
cache is 2Gig, find a 2Gig disk file that has nothing to do with your test 
suite and read it.  Or generate 2Gig of gibberish and write it to disk, then 
delete that file.  Pah.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to