Bypass system disk cache

M

mrfchung

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
 
B

bugbear

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?

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
 
R

Roedy Green

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?

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
 
D

David Gourley

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

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
 
L

Lew

David said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top