Hi Guys
I have a question:
I have a project that with file IO but need to bypass the system disk
cache.
Is there anyway that I can disable the system disk cache (to the
particular drive or file) ?
If it is not possible, how can I bypass the cache to the file?
Thanks a lot on advance.
Frankie Chung
bugbear - 07 Aug 2007 12:50 GMT
> Hi Guys
>
[quoted text clipped - 7 lines]
>
> If it is not possible, how can I bypass the cache to the file?
Even if this were possible on the OS ("fairly unlikely")
it's "extremely unlikely" that such controls are available
in a platform portable language like java.
Perhaps if you tell us your motivation for this
unusual request, someone can help you further.
BugBear
Roedy Green - 07 Aug 2007 15:26 GMT
>I have a question:
>
[quoted text clipped - 5 lines]
>
>If it is not possible, how can I bypass the cache to the file?
That will require platform specific code, if it is possible at all.
The trend in OSes is to give individual apps less and less power to
control the OS. If you can find some method in the C++ library, use
it and hook it up to Java with JNI.
http://mindprod.com/jgloss/jni.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
David Gourley - 07 Aug 2007 22:51 GMT
> Hi Guys
>
[quoted text clipped - 11 lines]
>
> Frankie Chung
I haven't done this kind of thing for a while. But in my murky past you
often wanted to do this for databases (because they had their own
caching mechanism which worked better than "simple" file system cache).
Can you mount a raw disk partition on your operating system? (because
this will usually bypass the file system cache) (but add some other
headaches for your code...)
Dave
Lew - 07 Aug 2007 23:31 GMT
mrfchung@gmail.com wrote:
>> Is there anyway that I can disable the system disk cache (to the
>> particular drive or file) ?
>>
>> If it is not possible, how can I bypass the cache to the file?
> I haven't done this kind of thing for a while. But in my murky past you
> often wanted to do this for databases (because they had their own
> caching mechanism which worked better than "simple" file system cache).
> Can you mount a raw disk partition on your operating system? (because
> this will usually bypass the file system cache) (but add some other
> headaches for your code...)
Proving again that it's a system configuration matter, not a Java matter.
Any OS that you would seriously consider for a high-volume server supports raw
I/O.

Signature
Lew