C
Chris
We've got an app which is running slow, and a CPU profiler shows that 90% of
the time is being spent in java.io.RandomAccessFile.seek(). This is
mystifying, because we are reading 2K pages sequentially out of about 30
files, so there should be at maximum 30 seeks. At 10ms per seek, it should
take 300ms, but it actually is taking 2 seconds.
Is there any possible way for Java to measure the number of disk seeks and
when they're happening?
If not, are there any operating-system level tools that will do it? We're on
Win XP. It wouldn't hurt to have a tool that would do it on Linux as well.
****
On a related question: if I go through the hassle of learning about NIO and
selectors for disk access, is it possible that multiple threads, all
contending for different pages on disk randomly, can have their requests
scheduled intelligently? Can NIO notify me when a page has been read into
memory? My guess is that NIO can do this, but I'd hate to blow a week on it
to find out that it can't.
the time is being spent in java.io.RandomAccessFile.seek(). This is
mystifying, because we are reading 2K pages sequentially out of about 30
files, so there should be at maximum 30 seeks. At 10ms per seek, it should
take 300ms, but it actually is taking 2 seconds.
Is there any possible way for Java to measure the number of disk seeks and
when they're happening?
If not, are there any operating-system level tools that will do it? We're on
Win XP. It wouldn't hurt to have a tool that would do it on Linux as well.
****
On a related question: if I go through the hassle of learning about NIO and
selectors for disk access, is it possible that multiple threads, all
contending for different pages on disk randomly, can have their requests
scheduled intelligently? Can NIO notify me when a page has been read into
memory? My guess is that NIO can do this, but I'd hate to blow a week on it
to find out that it can't.